Commit Graph

36480 Commits

Author SHA1 Message Date
Justin M. Keyes
aea9aeee78 refactor: _meta/builtin_types.lua => vimfn_types.lua #39658
Problem:
`builtin_types.lua` seems to be about vimfn (aka "eval", aka
"vimscript", …) specifically, whereas `builtin.lua` is about the Lua
stdlib.

Solution:
Rename it to `vimfn_types.lua`, to align with `vimfn.gen.lua`.
2026-05-07 21:21:04 +00:00
Justin M. Keyes
55fd73a831 perf(server): use 1 request instead of 3 #39655 2026-05-07 16:13:41 -04:00
Justin M. Keyes
b351024daf build(docs): lint more quasi-keysets #39654
Problem:
Linter missed backtick and double-quote keynames in the quasi-keyset of
the `nvim_create_user_command` docstring.

Solution:
Update the linter to check backtick-surrounded and quote-surrounded key
names.
2026-05-07 16:00:26 +00:00
Szymon Wilczek
3639f7a867 feat(server): add v:useractive, use it in serverlist(info=true) #39423
Problem:
When showing the :connect menu, it is useful to know which servers
are most-recently active. But we don't have a good way to detect that.

Solution:
- Introduce `v:useractive`.
- Include this timestamp in `serverlist({info=true})`.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-07 10:47:51 -04:00
Quentin
97a557bd1e docs: expand nvim_create_user_command docs #39540 2026-05-07 09:18:19 -04:00
Szymon Wilczek
0c3e6e1b0e fix(treesitter): crash in ts_parser_delete after gc #39497
Problem:
parser_gc() calls ts_parser_delete() but leaves the userdata pointer
pointing to freed memory. If the GC finalizer runs at an unexpected time
(e.g. inside nvim_buf_get_lines #39411), a stale pointer could cause a crash.

Solution:
- NULL out `*ud` after ts_parser_delete() in parser_gc()
- Update parser_check() to handle NULL with a clear error message,
guarding all parser methods against UAF

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-07 08:39:07 -04:00
Eisuke Kawashima
7e778205ab docs: adjust modelines for HTML rendering #39649
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-05-07 08:32:27 -04:00
Justin M. Keyes
bf8cdb340b fix(treesitter): drop select() kwargs #39646
Problem:
Unnecessary kwargs.

Solution:
Use param instead of kwargs.
2026-05-07 11:14:17 +00:00
Justin M. Keyes
df5d559878 Merge #39626 docs 2026-05-07 05:00:55 -04:00
glepnir
1fd82615b1 refactor(excmd): remove duplicate get_cmd_argt (#39643)
Problem:
`excmd_get_argt` and `get_cmd_argt` do the same thing.

Solution:
Drop `get_cmd_argt` and update its callers to use `excmd_get_argt`.
2026-05-07 08:55:30 +00:00
Justin M. Keyes
662c556a3e docs: rename "tabpage" 2026-05-07 10:36:55 +02:00
Justin M. Keyes
80d83d75eb docs: misc, rename "tabpage"
Co-authored-by: michael-grunder <michael.grunder@gmail.com>
Co-authored-by: Olivia Kinnear <git@superatomic.dev>
Co-authored-by: Felipe Matarazzo <felipemps@protonmail.com>
2026-05-07 10:36:48 +02:00
github-actions[bot]
d12dd07c7a docs: update version.c #39466
vim-patch:1de887681 No guidance for AI coding agents
vim-patch:9.2.0421: vimball: can smuggle Vimscript into VimballRecord file
vim-patch:620557bd4 runtime(doc): Update help tags file
vim-patch:9.2.0422: popup: leave stray char when scrollbar changes
vim-patch:9.2.0431: blob encoding can be improved
vim-patch:9.2.0434: cscope: filename interpreted by /bin/sh
vim-patch:9.2.0448: Vim9: dangling cmdline pointer after skip_expr_cctx()
vim-patch:9.2.0449: Make proto fails in non GTK builds


vim-patch:9.2.0409: memory leaks in copy_substring_from_pos()
2026-05-07 03:19:43 -04:00
Yi Ming
9174157f74 feat(pos): pos:to_offset(), pos.offset() #39564
Problem:
For a given position, it is not easy to compare which of several other positions is closest to it.

Solution:
Add support for converting `vim.Pos` to a buffer byte offset.

This allows for sorting, e.g:
```lua
table.sort(positions, function(pos1, pos2)
  return pos1:to_offset() < pos2:to_offset()
end
```

Or a binary search, e.g:
```lua
vim.list.bisect(positions, pos, { key = function(pos) return pos:to_offset() end })
```
2026-05-06 16:37:16 -04:00
dependabot[bot]
7b00f58d84 ci: bump actions/labeler in the github-actions group across 1 directory
Bumps the github-actions group with 1 update in the / directory: [actions/labeler](https://github.com/actions/labeler).


Updates `actions/labeler` from 6 to 6.0.1
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v6...v6.0.1)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-06 19:32:56 +02:00
luukvbaal
dda30fdfbb fix(messages): disallow source="nvim" progress msg #39315
Problem:  Internal progress messages use the "nvim" source (since
          ff68fd6b), plugins shouldn't be allowed to set the progress
          message source to "nvim". The message ID used for internal
          progress messages is not identifiable as such.
Solution: Disallow setting opts->source to "nvim" with nvim_echo().
          Refactor msg_progress() and callees to bypass nvim_echo().
          Prepend message id for internal progress messages with "nvim.".
2026-05-06 12:25:25 -04:00
Justin M. Keyes
27e7aba982 Merge #39630 from ofseed/lua-no-memoize 2026-05-06 11:15:31 -04:00
Mike J McGuirk
ab69f81c16 fix(lua): increase vim.F deprecation version [skip ci] #39632
Problem: Deprecations for vim.F set a version too early.

Solution: Bump the deprecation version.
2026-05-06 11:13:15 -04:00
Lewis Russell
d7ef55e881 fix(vim.iter): add richer generic annotations
Improve the vim.iter annotations with richer generics that track element and
tuple types through iterator pipelines, including multi-value stages and
list-specific methods.

Extend the LuaCATS parser and vimdoc generator so those richer generic classes
and overloads round-trip into the generated help. These annotations are only
supported by EmmyLua, so LuaLS still uses a broader fallback in _meta.lua.

AI-assisted: Codex
2026-05-06 16:02:59 +01:00
Tomasz N
2b7a00746d fix(ui2): entering the pager fails if <ESC> is remapped to :fclose (#39462)
Problem:  Entering the pager fails if <ESC> is remapped to :fclose by user.
Solution: Avoid executing mappings with nvim_feedkeys() that closes expanded cmdline.
2026-05-06 15:42:26 +02:00
Szymon Wilczek
c3f803c3b6 feat(server): serverlist({info=true}) gets detailed info #39392
Problem:
UI tools and orchestration engines need more context than just raw
socket addresses from serverlist(). Without knowing if a server belongs
to the current instance or knowing its PID, UIs cannot display
meaningful options to users.

Solution:
- Added the `info=v:true` option to `serverlist()`.
- When `info` is requested, it implies `peer=true` and returns a list of
  dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and
  `own`.
- Uses an RPC request to `getpid()` across the socket to fetch the
  peer's actual process ID.

Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-06 08:55:34 -04:00
STG
0ea720f281 fix(ui2): error E518 when typing "vim:" in cmdline #39599
Problem: `vim:`, etc. in cmdline are interpreted as modeline, causing error E518.

Solution: Set 'nomodeline' when creating the buffers.
2026-05-06 08:43:01 -04:00
Yi Ming
b8af8d7672 fix(lua): return v[field] instead of nil when v[field] is false
Problem:
When `v[field]` returns `false`, the ternary operator will make it return `nil`.

Solution:
Return `v[field]` once `v` is not `nil`.
2026-05-06 20:33:58 +08:00
Yi Ming
83f9944911 revert: "perf(lua): memoize key_fn results"
This reverts commit 8394775241.
2026-05-06 20:32:07 +08:00
Olivia Kinnear
fcd1d97265 feat(lua)!: vim.isnil, vim.nonnil, deprecate vim.F #39495 2026-05-06 08:15:00 -04:00
Yi Ming
f562204a5c feat(diagnostic)!: deprecate format as a table #39603 2026-05-06 07:01:21 -04:00
glepnir
1787965d77 feat(api): nvim_get_commands returns desc #39623
Problem:
Can't get a command's description from nvim_get_commands when
cmd is string.

Solution:
Returns "desc" field in nvim_get_commands.
`definition` is now empty when cmd is function type.
2026-05-06 06:36:39 -04:00
Nathan Zeng
c286c9d686 feat(treesitter): provide select() #39069
Problem: No public method for treesitter incremental selection.

Solution: Add `vim.treesitter.select()`.
2026-05-06 06:16:58 -04:00
zeertzjq
d9a7b68795 vim-patch:9.2.0447: cindent does not ignore comments (#39622)
Problem:  When find_start_brace() scans backwards for the enclosing
          block, '{' and '}' inside // and /* */ comments are counted,
          producing wrong indent for code following such comments
          (rendcrx).
Solution: Implement FM_SKIPCOMM in findmatchlimit() to track block-
          comment state and skip matches inside comments. Pass
          FM_SKIPCOMM from cindent's call sites
          (find_start_brace, find_match_char, cin_iswhileofdo,
          get_c_indent).

fixes:  vim/vim#4
fixes:  vim/vim#648
fixes:  vim/vim#19578
closes: vim/vim#19581
closes: vim/vim#20111

c06002f3cb

Co-authored-by: magnus-rattlehead <magnus-rattlehead@users.noreply.github.com>
2026-05-06 01:45:18 +00:00
zeertzjq
cfa803d895 vim-patch:9.2.0446: runtime(netrw): off-by-one bug in s:NetrwUnMarkFile() (#39620)
Problem:  off-by-one bug in s:NetrwUnMarkFile()
Solution: Correctly loop through all buffers to unlet all variables
          (J. Paulo Seibt)

When the function loops through buffers to clear s:netrwmarkfilelist_#
and s:netrwmarkfilemtch_#, it skips the last one at bufnr('$'), messing
up mark highlights and causing other functions that operate on those
arrays (like delete or rename) to target stale marked files.

The bufnr() help page says that bufnr("$") returns the highest buffer
number of existing buffers, so while ibuf < bufnr("$") does not clear
the last buffer-local arrays.

To reproduce:

Just opening a fresh Vim and running :Ex opens a netrw buffer at the
highest number. Then, typing mu after marking some files triggers the
mark highlight bug, and finally typing D would act like calling the
delete function against the previous marked files, as the buffer-local
arrays where not touched by s:NetrwUnMarkFile.

closes: vim/vim#20129

7ccc273a4c

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-06 09:23:22 +08:00
zeertzjq
60d069d422 vim-patch:9.2.0445: win_fix_scroll() called before win_comp_pos() in command_height() (#39619)
Problem:  win_fix_scroll(true) is called before win_comp_pos() in
          command_height().
Solution: Move win_fix_scroll(true) after win_comp_pos(), matching the
          ordering used in win_drag_status_line() (Jesse Rosenstock).

Patch 9.2.0413 added win_fix_scroll(true) to command_height() to handle
splitkeep when cmdheight changes, but placed the call before win_comp_pos().
win_fix_scroll() reads w_winrow to detect window movement
(620557bd48/src/window.c (L7266)),
but w_winrow is not recomputed until win_comp_pos() runs
(620557bd48/src/window.c (L6516)).
This causes incorrect scroll adjustments and was breaking
Test_smoothscroll_incsearch on macOS CI.

closes: vim/vim#20138

40fc78f0a1


Co-authored-by: Gemini

Co-authored-by: Jesse Rosenstock <jmr@google.com>
2026-05-06 09:23:09 +08:00
zeertzjq
2bb426ce4a vim-patch:9.2.0443: GUI: cancelling save dialog overwrites or discards unnamed buffer (#39617)
Problem:  When closing gvim with an unsaved unnamed buffer, choosing
          "Yes" in the "Save changes?" dialog and then "Cancel" in the
          file selection dialog either silently writes the buffer to a
          file named "Untitled" (overwriting any existing file with
          that name) or discards the buffer altogether
          (vibs29, after v9.1.0265).
Solution: In dialog_changed(), if browse_save_fname() leaves the buffer
          without a file name, treat it as a cancel and return without
          saving.  Also stop clearing the modified flag in the restore
          path on write failure, so the unsaved changes are kept and
          the caller (e.g. gui_shell_closed()) can also cancel the
          close.  Pre-fill the file dialog with "Untitled" to match
          the preceding "Save changes to ..." prompt.  Add a test for
          the write-failure path (Hirohito Higashi).

fixes:  vim/vim#20132
closes: vim/vim#20143

cf947e7ef0

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-05-06 08:19:30 +08:00
zeertzjq
f39f6f72a7 vim-patch:1903020: runtime(autopkgtest): update syntax script (#39616)
Fix some typos, and move a deprecated keyword where it belongs

closes: vim/vim#20141

1903020b82

Co-authored-by: Arnaud Rebillout <elboulangero@gmail.com>
2026-05-06 08:19:16 +08:00
zeertzjq
c96740c09f Merge pull request #39615 from zeertzjq/vim-9.2.0435
vim-patch:9.2.{0435,0444}
2026-05-06 08:08:05 +08:00
zeertzjq
d1c3d6fbaa vim-patch:9.2.0444: Cannot set 'path' option via modeline
Problem:  Cannot set 'path' option via modeline (zeertzjq, after v9.2.0435)
Solution: Revert the part that disallows setting 'path' via modeline.

closes: vim/vim#20137

88fb739918

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-06 07:25:00 +08:00
zeertzjq
b06f8b174f vim-patch:9.2.0435: [security]: backticks in 'path' may cause shell execution on completion
Problem:  [security]: Backticks enclosed shell commands in the 'path'
          option value are executed during completion (q1uf3ng).
Solution: Skip path entries containing backticks, add P_SECURE to 'path'
          option, so that it cannot be set from a modeline (for symmetry with
          the 'cdpath' option)

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-hwg5-3cxw-wvvg

Supported by AI.

190cb3c2b9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-06 07:23:07 +08:00
zeertzjq
d0582fcc74 vim-patch:9.2.0442: completion: i_CTRL-X_CTRL-V doesn't use dict from customlist (#39614)
Problem:  Completion with i_CTRL-X_CTRL-V doesn't use dict from cmdline
          "customlist" completion.
Solution: Include abbr/kind/menu/info in the completion items
          (zeertzjq).

closes: vim/vim#20139

2bfddbea47
2026-05-05 23:17:21 +00:00
Yi Ming
97de5f145a perf(lua): memoize key_fn results #39568
Problem:
When using `vim.list.unique` or `vim.list.bisect`, if the `key` function is
complex, it can degrade performance, because it is invoked on every comparison

Solution:
The `key` interface convention is designed specifically to address this issue;
performance can be improved by memoizing its results.

Also added the shorthand use of the field name string as the key.
2026-05-05 17:04:11 -04:00
Tristan Knight
ed194b99ac fix(lsp): support nested workspace registrations #39574
Problem:
Nested workspace capabilities like workspace.fileOperations.didCreate and
workspace.textDocumentContent are not handled consistently for dynamic and
static registration provider lookup.

Solution:
Generate explicit registration-provider mappings from the LSP metadata and use
them when registering and querying capabilities. Add coverage for dynamic and
static nested workspace registrations.
2026-05-05 16:36:02 -04:00
Yi Ming
264fbc0ace fix(lua): avoid __index when deciding if a table is a list #39556
Problem:
When a table has `__index`, `vim.islist` is unreliable.

Solution:
Index using `rawget`.
2026-05-05 16:32:20 -04:00
Ellison
b1ebf45a6d fix(vim.net): unreliable integration tests #39594 2026-05-05 16:26:59 -04:00
Daigo Yamashita
97ef9f74b2 fix(events): trigger WinScrolled during 'incsearch' #39308
Problem:
With 'incsearch' enabled, the window can scroll while typing a
search pattern, but WinScrolled is not triggered until the next user
action in Normal mode. The event is effectively skipped for every
scroll that happens while the search prompt is still open.

Solution:
Call may_trigger_win_scrolled_resized() after update_screen()
in may_do_incsearch_highlighting() and finish_incsearch_highlighting().
2026-05-05 14:34:53 -04:00
David Balatero
19a2ef5afa test: unreliable pack_spec.after_each: "EBUSY: resource busy or locked" #39606
Problem:
`EBUSY` during cleanup:
Windows CI can intermittently fail `pack_spec.lua` with `EBUSY` while removing
`site/pack/core/opt/plugindirs`.

This can happen because:
- the test Nvim session may still be alive when `after_each()` removes the pack
  directory
- Windows does not allow removing a directory while another process still has an
  open handle below it
- startup-time `vim.pack.add()` performs a real `git clone`, so process and file
  handle release timing can vary on slower runners

Startup timeout:
The startup tests can also fail before cleanup because they wait for `_G.done`
with a fixed timeout. That timeout includes the time needed for startup to run
`vim.pack.add()` and finish the local clone.

Solution:
Close before cleanup:
Capture the pack, lockfile, and log paths while the test Nvim session is still
available, then call `n.check_close()` before removing the pack directory.

Extend Windows startup wait:
Increase the `_G.done` retry budget only on Windows so startup-time
`vim.pack.add()` has more time to finish on slower CI runners.
2026-05-05 13:57:56 -04:00
David Balatero
78111e5371 test: flaky terminal channel exitcode check #39580
Problem:
The `nvim_get_chan_info()` terminal channel test used `shell-test INTERACT` to verify that `jobstop()` reports an unhandled `SIGHUP` as exit code `129`.

`INTERACT` reads from stdin with `fgets()`, so closing the PTY could race with `SIGHUP` delivery. If `fgets()` observed EOF first, `shell-test` exited normally with code `0`, causing intermittent failures on slower sanitizer builds.

Solution:
Add a `shell-test HOLD` mode that prints a readiness prompt and then waits without reading stdin. Use it for the `SIGHUP` assertion so PTY EOF cannot make the helper exit normally before the signal path is observed.
2026-05-05 11:45:41 -04:00
dependabot[bot]
10b739aac1 ci: bump msys2/setup-msys2 from 2.31.0 to 2.31.1 in the github-actions group across 1 directory (#39604)
ci: bump msys2/setup-msys2

Bumps the github-actions group with 1 update in the / directory: [msys2/setup-msys2](https://github.com/msys2/setup-msys2).


Updates `msys2/setup-msys2` from 2.31.0 to 2.31.1
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](cafece8e6b...e9898307ac)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-05 11:26:44 -04:00
Justin M. Keyes
e768d81268 ci: bump the github-actions group #39600
Bumps github-actions:
[korthout/backport-action](https://github.com/korthout/backport-action)
[github/codeql-action](https://github.com/github/codeql-action)
[zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action)

Updates `korthout/backport-action` from 4.3.0 to 4.5.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](3c06f323a5...7c3f6cd584)

Updates `github/codeql-action` from 4.35.1 to 4.35.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.35.1...v4.35.2)

Updates `zizmorcore/zizmor-action` from 0.5.2 to 0.5.3
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](71321a20a9...b1d7e1fb5d)

updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: korthout/backport-action
  dependency-version: 4.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-05 09:20:39 -04:00
Yi Ming
b56f7c6edd fix(diagnostic): status() respects config.signs #39525
Problem:
`diagnostic.status` only follows the `config.status.format` setting to determine how to display diagnostic signs. However, `signs` can actually also be configured via `config.signs.text`.

Solution:
If the user has set symbols via `config.status.format`, let that determine the content of `signs`; otherwise, use `config.signs.text` for display.

TODO: drop support `type(config.status.format) == 'table'`; users should just configure `config.signs.text` directly.
2026-05-05 08:35:35 -04:00
zeertzjq
e4876d8126 Merge pull request #39598 from zeertzjq/vim-9.1.1756
vim-patch:9.{1.1756,2.0438}
2026-05-05 10:47:27 +08:00
zeertzjq
64249d2f2a vim-patch:9.2.0438: tests: test_plugin_termdebug is flaky
Problem:  Test_termdebug_tbreak(), Test_termdebug_basic(), and
          Test_termdebug_toggle_break() use synchronous assert_equal()
          to check breakpoint signs immediately after sending commands
          to gdb.  On slow CI (ASAN, ARM64, macOS) gdb may not have
          processed the response yet, causing the sign to be missing.
Solution: Wrap the three assertions in WaitForAssert() to poll until
          the signs are placed, matching the pattern already used by
          the other assertions in the same tests (Jesse Rosenstock).

closes: vim/vim#20133

20a124a6e0

Co-authored-by: Jesse Rosenstock <jmr@google.com>
Co-authored-by: Gemini
2026-05-05 10:29:49 +08:00
zeertzjq
ddee275c69 vim-patch:9.1.1756: termdebug: Need a few more user commands
Problem:  termdebug: Need a few more user commands
Solution: Add the :RunOrContinue and the :ToggleBreak user commands
          (bennyyip)

closes: vim/vim#18283

c975d62473

Co-authored-by: bennyyip <yebenmy@gmail.com>
2026-05-05 10:29:49 +08:00