Commit Graph

9970 Commits

Author SHA1 Message Date
Christian Clason
f3ee2440c7 build(deps): bump tree-sitter-lua to v0.4.1 2025-12-31 16:49:24 +01:00
zeertzjq
bd10f781b8 vim-patch:9.1.2035: filetype: filetype: Fennel fnlm files are not recognized (#37178)
Problem:  filetype: Fennel fnlm files are not recognized
          (Alexei Mozaidze, after v9.1.2034)
Solution: Detect *.fnlm files as fennel filetype, revert detecting
          *.fnml files

related: vim/vim#19047

ea189a6f4d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-31 20:25:19 +08:00
zeertzjq
dddb125b0b vim-patch:5c2b594: runtime(rust): Update indentation after nested array literal (#37177)
fixes:  vim/vim#18974
closes: vim/vim#19042

5c2b594d0e

Co-authored-by: Brian Carbone <brian@briancarbone.com>
2025-12-31 10:53:06 +00:00
zeertzjq
8e80e54478 vim-patch:9.1.2034: filetype: Fennel fnml files are not recognized (#37176)
Problem:  filetype: Fennel fnml files are not recognized
          (Alexei Mozaidze)
Solution: Detect *.fnml files as fennel filetype

Reference:
- https://fennel-lang.org/changelog#160--2025-10-13

fixes: vim/vim#19047

9c87af5c3c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-31 10:39:50 +00:00
Peter Cardenas
f8ac713448 fix(treesitter): use metadata in :EditQuery captures #37116
Problem:
When the `#offset!` directive is used with `:EditQuery`, the query does not take the offset into consideration when creating the extmark to preview the capture.

Solution:
Use the capture metadata to modify the node range before creating the extmark.
2025-12-30 10:44:18 -05:00
Justin M. Keyes
b24522e77b Merge #37113 from echasnovski/pack-better-revert 2025-12-30 10:40:19 -05:00
glepnir
9833f0da5f fix(diagnostic): unstable sorting by severity #37154
Problem: random order for same-severity diagnostics, severity_sort reversed.

Solution: add stable comparison with _extmark_id tiebreaker.
2025-12-30 04:28:32 -05:00
Justin M. Keyes
ea3562d739 Merge #37142 from echasnovski/pack-safer-del 2025-12-30 04:20:33 -05:00
Phạm Bình An
f8d0190491 docs(prompt): Lua example, adjust for multiline input #37121 2025-12-30 03:57:35 -05:00
Justin M. Keyes
10b610bbd9 Merge #36870 from justinmk/luacore 2025-12-30 02:11:00 -05:00
Jason Shipman
825e182139 fix(vim.fs): avoid fn.fnamemodify in fs.root #37162
Problem: vim.fs.root uses vim.fn.fnamemodify. vim.fn table isn't
available from nvim -ll or thread contexts.

Solution: Swap out vim.fn.fnamemodify for vim.fs.abspath.

This is a temporary workaround and may be reverted since the
long-term plan is to use more fast=true "fn" functions from vim.fs
where possible.
2025-12-30 01:57:06 -05:00
Justin M. Keyes
1d70c96e5b build: move shared.lua to _core/ 2025-12-30 01:44:52 -05:00
Justin M. Keyes
20e77c5d88 build: ship "_core/*" as bytecode (built-into Nvim binary)
Problem:
We want to encourage implementing core features in Lua instead of C, but
it's clumsy because:
- Core Lua code (built into `nvim` so it is available even if VIMRUNTIME
  is missing/invalid) requires manually updating CMakeLists.txt, or
  stuffing it into `_editor.lua`.
- Core Lua modules are not organized similar to C modules, `_editor.lua`
  is getting too big.

Solution:
- Introduce `_core/` where core Lua code can live. All Lua modules added
  there will automatically be included as bytecode in the `nvim` binary.
- Move these core modules into `_core/*`:
  ```
  _defaults.lua
  _editor.lua
  _options.lua
  _system.lua
  shared.lua
  ```

TODO:
- Move `_extui/ => _core/ui2/`
2025-12-30 01:44:24 -05:00
Kyle
03377b9552 feat(terminal): include sequence terminator in TermRequest event (#37152)
Problem:
Terminals should respond with the terminator (either BEL or ST) used in
the query so that clients can reliably parse the responses. The
`TermRequest` autocmd used to handle background color requests in the
terminal does not have access to the original sequence terminator, so it
always uses BEL. #37018

Solution:
Update vterm parsing to include the terminator type, then forward this
data into the emitted `TermRequest` events for OSC/DCS/APC sequences.
Update the foreground/background `TermRequest` callback to use the same
terminator as the original request.

Details:
I didn't add the terminator to the `TermResponse` event. However, I
assume the `TermResponse` event doesn't care about the terminator
because the sequence is already parsed. I also didn't update any of the
functions in `src/nvim/vterm/state.c` that write out responses. It
looked like those all pretty much used ST, and it would be a much larger
set of changes. In that same file, there's also logic for 8 bit ST
sequences, but from what I can tell, 8 bit doesn't really work (see `:h
xterm-8bit`), so I didn't use the 8 bit ST at all.
2025-12-29 16:30:23 -06:00
zeertzjq
ddd6ac5083 vim-patch:1bc3610: runtime(rust): partly revert e426245b, it causes more issues than it solves (#37156)
related: vim/vim#18974

1bc3610b0a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-29 17:07:26 +08:00
Evgeni Chasnovski
28ba99e026 feat(pack)!: suggest "delete" code action only for not active plugins
Problem: Deleting active plugins can lead to a situation when it is
  reinstalled after restart.

Solution: Suggest "delete" code action only for not active plugins.
  Whether a plugin is not active is visible by a hint in its header.
2025-12-28 18:39:26 +02:00
Evgeni Chasnovski
c339b83a4a feat(pack): hint in confirmation buffer that plugin is not active
Problem: After `vim.pack.update()` it is not clear if plugin is active
  or not. This can be useful to detect cases when plugin was removed
  from 'init.lua' but there was no `vim.pack.del()`.

Solution: Add ` (not active)` suffix with distinctive highlighting to
  header of plugins that are not active.
  It will also be shown in in-process LSP document symbols to have quick
  reference about which plugins are not active.
2025-12-28 18:39:26 +02:00
Evgeni Chasnovski
f5707a9c42 feat(pack)!: make del() only remove non-active plugins by default
Problem: Using `vim.pack.del()` to delete active plugin can lead to
  a situation when this plugin is reinstalled after restart. Removing
  plugin from 'init.lua' is documented, but can be missed.

Solution: Make `del()` only remove non-active plugins by default and
  throw an informative error if there is an active plugin.

  Add a way to force delete any plugin by adding `opts.force`. This also
  makes `del()` signature be the same as other functions, which is nice.
2025-12-28 18:39:26 +02:00
zeertzjq
c53fb58c15 vim-patch:e426245: runtime(rust): clean-up indent script, handle opening empty line correctly (#37139)
fixes: vim/vim#18974

e426245bb3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-28 22:39:44 +08:00
zeertzjq
80a8c3d23b vim-patch:ee3f10a: runtime(bpftrace): add indention plugin (#37132)
Problem:  No indention support when editing bpftrace files.
Solution: Add indention settings based on cindent with custom options.

closes: vim/vim#19030

ee3f10af87

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-28 00:20:42 +00:00
zeertzjq
5670dde1af vim-patch:a7f703c: runtime(doc): improve :catch documentation (#37131)
related: vim/vim#18984
closes:  vim/vim#19029

a7f703c215

Co-authored-by: Mao-Yining <101858210+mao-yining@users.noreply.github.com>
2025-12-28 08:18:48 +08:00
zeertzjq
7f1d7271d5 vim-patch:9.1.2027: filetype: bicep filetype used for 2 bicep file types (#37130)
Problem:  filetype: bicep filetype used for 2 bicep file types
Solution: Detect *.bicepparam files as bicep-param filetype, include
          new bicep-params and bicep filetype plugin
          (Scott McKendry)

The bicep language server handles parameter files differently than
regular bicep files. Treating them the same at the editor level leads to
false positive diagnostics in the editor.

References:

Bicep Language Constants:
- 51392d32ca/src/Bicep.Core/LanguageConstants.cs (L23)
VS Code Extension definition:
- 51392d32ca/src/vscode-bicep/package.json (L47)

closes: vim/vim#19026

4e722fdfdd

Co-authored-by: Scott McKendry <me@scottmckendry.tech>
2025-12-28 00:16:20 +00:00
zeertzjq
1e44a001ec vim-patch:9.1.2024: 'fsync' option cannot be set per buffer (#37129)
Problem:  'fsync' option cannot be set per buffer
Solution: Make 'fsync' option global-local
          (glepnir)

closes: vim/vim#19019

4d5b303726

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-28 08:14:45 +08:00
zeertzjq
47aef025a7 vim-patch:ffd5c52: runtime(compiler): ignore 'Found' messages in ruff and ty compiler (#37119)
while at it, also update the ty command line

closes: vim/vim#19012

ffd5c52d23

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-12-27 01:46:13 +00:00
zeertzjq
7991e4aa5e vim-patch:538da34: runtime(netrw): Fix reading UNC paths on windows (#37120)
Problem:  When Vim is launched with a UNC directory, netrw treats it as a
          relative path and compose it again.
Solution: This is due to `exists("g:netrw_cygwin")` always being true.
          We can directly use `g:netrw_cygwin`.

closes: vim/vim#19015

538da34ad3

Co-authored-by: tao <2471314@gmail.com>
2025-12-27 01:44:37 +00:00
zeertzjq
c11153b320 vim-patch:9.1.2021: filetype: fluent files are not recognized (#37117)
Problem:  filetype: fluent files are not recognized
Solution: Detect *.ftl files as fluent filetype (ners)

References:
- https://projectfluent.org/

closes: vim/vim#19011

b91b30643a

Co-authored-by: ners <ners@gmx.ch>
2025-12-27 01:35:19 +00:00
Evgeni Chasnovski
c9965491d0 feat(pack): allow running update() without Internet connection
Problem: There is now way to run `update()` without Internet connection
  while there are some workflows that do not require it. Like "switch
  plugin version" and "revert latest update".

Solution: Add `opts.offline` to `update()`. This also allows now to
  treat `vim.pack.update(nil, { offline = true })` as a way to
  interactively explore currently installed plugins.
2025-12-26 20:05:12 +02:00
Evgeni Chasnovski
8c28507fcf feat(pack): allow choosing update target in update()
Problem: There are two fairly common workflows that involve lockfile and
  can be made more straightforward in `vim.pack`:

    1. Revert latest update. Like if it introduced unwanted behavior.

    2. Update to a revision in the lockfile. Like if already updated
       on another machine, verified that everything works, `git add` +
       `git commit` + `git push` the config, and want to have the same
       plugin states on current machine.

Solution: Make `update` allow `opts.target`. By default it uses
  `version` from a plugin specification (like a regular "get new changes
  from source" workflow). But it also allows `"lockfile"` value to
  indicate that target revision after update should be taken from the
  current lockfile verbatim.

  With this, the workflows are:

    1. Revert (somehow) to the lockfile before the update, restart, and
       `vim.pack.update({ 'plugin' }, { target = 'lockfile' })`. If Git
       tracked, revert with `git checkout HEAD -- nvim-pack-lock.json`.
       For non-VCS tracked lockfile, the revisions can be taken from the
       log file. It would be nicer if `update()` would backup a lockfile
       before doing an update, but that might require discussions.

    2. `git pull` + `:restart` +
       `vim.pack.update(nil, { target = 'lockfile' })`.
       The only caveats are for new and deleted plugins:
        - New plugins (not present locally but present in the lockfile)
          will be installed at lockfile revision during restart.
        - Deleted plugins (present locally but not present in the
          lockfile) will still be present: both locally *and* in the
          lockfile. They can be located by
          `git diff -- nvim-pack-lock.json` and require manual
          `vim.pack.del({ 'old-plugin1', 'old-plugin2' })`.
2025-12-26 18:32:59 +02:00
Yi Ming
e855a23c02 feat(lsp): on_accept can return item to customize behavior #37092
Problem:
`on_accept` is a bit cumbersome to customize.

Solution:
* Before: users had to override the entire `on_accept` logic for their changes to be applied.
* Now: users can modify the item and return it to apply the modified changes, or return `nil` to fully customize how the changes are applied.
2025-12-26 00:08:12 -05:00
Evgeni Chasnovski
c8ea8374c8 docs(pack): use more tags and add "Use shorter source" example 2025-12-25 12:57:59 +02:00
Evgeni Chasnovski
0353d33b00 feat(pack)!: change src of installed plugin inside update() in place
Problem: Changing `src` of already installed plugin currently takes
  effect immediately inside `vim.pack.add()` and acts as "delete and
  later fresh install". Although more robust, this might lead to
  unintentional data loss (since plugin is deleted) if the plugin was
  manually modified or the new source is not valid.
  Also this introduces unnecessary differentiation between "change
  `version`" and "change `src`" of already installed plugin.

Solution: Require an explicit `vim.pack.update()` to change plugin's
  source. It is done by conditionally changing `origin` remote of the
  Git repo. The effect does not require update confirmation in order to
  have new changes fetched from the new `src` right away.

  If in the future there are more types of plugins supported (i.e. not
  only Git repos), also do extra work (like delete + install) during
  `vim.pack.update()`.
2025-12-25 12:57:59 +02:00
Olivia Kinnear
29494f042c fix(ex): error handling for :lsp #37061 2025-12-25 03:19:12 -05:00
zeertzjq
20c96f1515 vim-patch:2006415: runtime(doc): add reference to searchcount() function
2006415016

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:53:31 +08:00
zeertzjq
0981d4e871 vim-patch:6d211bc: runtime(doc): Improve :catch documentation
fixes: vim/vim#18984

6d211bc4f0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:52:21 +08:00
zeertzjq
5681315b82 vim-patch:519dc39: runtime(make): Makefile highlighting breaks with ')' in string
Problem:  Makefile syntax highlighting incorrectly ends function calls
          when encountering ')' inside double or single quoted strings,
          causing incorrect highlighting for the remainder of the line.
Solution: Add makeDString and makeSString to the contains list for
          makeIdent regions. This allows strings to be recognized inside
          variable references and function calls.

fixes:  vim/vim#18687
closes: vim/vim#18818

519dc391d8

Co-authored-by: Beleswar Prasad Padhi <beleswarprasad@gmail.com>
2025-12-24 08:45:21 +08:00
zeertzjq
081feae3a3 vim-patch:aded554: runtime(make): Move target greedy match after $() to avoid region matching overflow
Partially revert 2a33b499a3d7f46dc307234847a6562cef6cf1d8, where all
syn match makeIdent are moved before syn region makeIdent to match $()
(reason: see https://github.com/vim/vim/pull/18403#issuecomment-3341161566)

However this results in https://github.com/vim/vim/issues/18890 ,
because lines like
`$(a) =`
will first start a region search beginning with `$(`
but then the whole target including `)` will be matched by
`syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1`
which leaves the region search for the never-found `)` and let the
region matching overflow.

Same for

`$(a) ::`
`$(a) +=`

The solution is to move those greedy target match back, so they take
priority and prevents region match from happening.

fixes:  vim/vim#18890
closes: vim/vim#18938

aded55463a

Co-authored-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
2025-12-24 08:45:05 +08:00
zeertzjq
dfcf03b1ba vim-patch:5e577c7: runtime(ftplugin): set different formatoptions for bpftrace
Problem:   Comment formatting does not work by default for bpftrace.
Solution:  Change default 'formatoptions' similarly as C and many other
           languages.

closes: vim/vim#18996

5e577c7aa8

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-24 08:44:51 +08:00
phanium
1aa26f5d55 fix(lua): separate vim.{g,b,w,t} types #37081
Problem:
When `vim.g.foo = 1`, `vim.b.foo` also appears as
a completion candidate (when use emmylua_ls).

Solution:
Define separate types.
2025-12-23 10:39:22 -05:00
zeertzjq
f93f341867 vim-patch:7982966: runtime(bpftrace): add base syntax plugin (#37077)
Problem:  No syntax highlighting for bpftrace files.
Solution: Add basic syntax rules, which cover comments, keywords, strings,
          numbers, macros and probes (the bpftrace specific items).

closes: vim/vim#18999

7982966f3e

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-23 00:00:28 +00:00
zeertzjq
471be48d56 vim-patch:9.1.2008: filetype: hylo files are not recognized
Problem:  filetype: hylo files are not recognized
Solution: Detect *.hylo files as hylo filetype (Ambrus Tóth)

References:
- https://hylo-lang.org/

closes: vim/vim#18994

9c9982240a

Co-authored-by: Ambrus Tóth <ping@ambrus.dev>
2025-12-23 07:20:37 +08:00
zeertzjq
92910a8ab8 vim-patch:9.1.2007: filetype: bpftrace hashbang lines are not recognized
Problem:    bpftrace files are not recognized from the hashbang line.
Solution:   Add a hashbang check (Stanislaw Gruszka)

closes: vim/vim#18992

f2814754c0

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-23 07:20:37 +08:00
zeertzjq
e1aceb0068 vim-patch:e09ff34: runtime(ty): include ty compiler plugin (#37066)
closes: vim/vim#18960

e09ff34129

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-12-22 08:13:20 +08:00
Jaehwang Jung
756e1eb017 fix(treesitter.foldexpr): duplicate callbacks #37048
Problem:
VimEnter clears foldinfo, so register_cbs is called again after
VimEnter. The duplicate parser callbacks break incremental fold
computation.

Solution:
Check if the callbacks are already registered.
2025-12-21 00:47:46 -05:00
Justin M. Keyes
0d206da461 Merge #37057 docs 2025-12-21 00:22:36 -05:00
Olivia Kinnear
ad330e99d1 fix(statusline): diagnostics spacing #36897 2025-12-20 23:58:38 -05:00
Justin M. Keyes
4485e715fb fix(options): deprecate 'gdefault', 'magic' 2025-12-20 22:07:27 -05:00
Justin M. Keyes
060993e438 docs: misc, lsp 2025-12-20 22:07:27 -05:00
Bryan Turns
bef68ba266 docs(lua): iInconsistent vim.keymap param name #37026
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].

Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
2025-12-20 19:26:44 -05:00
Eric Wong
6228acb74f feat(cmdline): completion for :TOhtml #37045 2025-12-20 19:17:38 -05:00
zeertzjq
245a4696a2 vim-patch:1a4a1b9: runtime(zip): Use :lcd instead of :cd in zip.vim (#37054)
closes: vim/vim#18967

1a4a1b9fa6

Co-authored-by: zoumi <zoumi@users.noreply.github.com>
2025-12-20 23:26:28 +00:00