Commit Graph

36518 Commits

Author SHA1 Message Date
luukvbaal
96fc7c150f fix(api): don't update 'title' when renaming non-curbuf #39743
Problem:  'title' is updated when changing the name of a non-current
          buffer with nvim_buf_set_name().
Solution: Set RedrawingDisabled when renaming the buffer.
2026-05-11 15:54:55 -04:00
luukvbaal
ce9f4f0369 fix(messages): reset redirection message column after :echon #39472
Problem:  Message redirection column for captured output is not reset
          after :echon since (4260f73, e63346df).

Solution: Ensure msg_ext_append is set before the kind with :echon.
2026-05-11 15:47:19 -04:00
Marcus Caisey
c4285acb92 fix(health): set 'tags' for help filetype #39742
Problem:
The `:checkhealth` buffer uses the help syntax, so help tag links (e.g.
`|clipboard|`) are highlighted like they are in help buffers. However,
unlike in help buffers, `CTRL-]` doesn't jump to the relevant help file.

I expect that if the `:checkhealth` buffer looks like a help buffer,
then it should behave like one where it makes sense. This comment from
/r/neovim suggests that this was the intention:
https://www.reddit.com/r/neovim/comments/5ghv3r/see_clipboard_how/dascnry/.

Solution:
Set `'tags'` in `checkhealth` buffers so that `:tag` and friends look
for tags in the help tags files.
2026-05-11 15:14:52 -04:00
Justin M. Keyes
11084f5db3 Merge #39730 from ofseed/lsp-remove-deprecated 2026-05-11 11:34:09 -04:00
bfredl
8275b7b491 Merge pull request #39736 from bfredl/odod
fix(style): some clang-tidy 22 fixes
2026-05-11 16:27:14 +02:00
zeertzjq
41e8201c6c fix(terminal): memory leak when pasting '=' register (#39738)
Problem:  Memory leak when pasting '=' register in terminal.
Solution: Free the register.
2026-05-11 13:07:39 +00:00
Yi Ming
9e5982f071 refactor(lsp)!: always require position_encoding 2026-05-11 20:37:56 +08:00
bfredl
7e9015fecb fix(style): some clang-tidy 22 fixes
CI currently uses clang-tidy 20, but this affects local builds
and CI is going to be upgraded sooner or later.

Some remaining systematic issues:

- clang-tidy warns agains any atoi() or atol() usage (because of no
  error handling)

- functions which takes (char *fmt, char *only_string_arg) and expect
  fmt to contain exactly one "%s" usage.

- error: initializing non-local variable with non-const expression depending on
  uninitialized non-local variable (cppcoreguidelines-interfaces-global-init)

  This is a much worse problem in C++ (hence C++ core guidelines) where
  initialization is intermingled with arbitrary code execution. I
  "think" in plain C, the linker will either resolve all these
  deterministically or barf an error. But with some restructuring
  we could make all static initialization actually static..
2026-05-11 13:31:10 +02:00
zeertzjq
17e737ed93 vim-patch:partial:9.2.0341: some functions can be run from the sandbox (#39733)
Problem:  some functions can be run from the sandbox
Solution: Block them, so they are not accessible from a modeline
          (q1uf3ng)

closes: vim/vim#19975

fcc4276db3

Co-authored-by: q1uf3ng <q1uf3ng@protone.me>
2026-05-11 10:21:16 +00:00
zeertzjq
5e756aa825 vim-patch:bfebd12: runtime(javacc): Check for existence of javaFuncDef syn group before clearing it (#39731)
fixes: vim/vim#20190

bfebd1209b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-11 17:20:40 +08:00
Yi Ming
fd51fb3fa0 refactor!: remove deprecated APIs 2026-05-11 16:51:58 +08:00
zeertzjq
0e7d51a378 vim-patch:9.2.0464: runtime(netrw): bookmarking directory uses current dir (#39729)
Problem:  runtime(netrw): bookmarking directory uses current dir
Solution: Correctly handle netrw actual directory (J. Paulo Seibt)

fixes:  vim/vim#10481
closes: vim/vim#20169

ec76ac620b

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-11 05:08:02 +00:00
Justin M. Keyes
5370eb0146 fix(lua): vim.wait(0) does not call loop_poll #39679
Problem:
Regression from c822a2657c: `vim.wait(0)` does not call `loop_poll`,
so `vim.wait(1)` is needed to "yield" from Lua.

Solution:
- Ensure that `vim._core.loop_poll()` is always called, even when `time=0`.
- Document how to interrupt Lua code (ctrl-c).

ref https://github.com/neovim/neovim/issues/6800
2026-05-10 14:22:31 -04:00
Yi Ming
c2d7dd781a feat(lsp): pass arbitrary positions to vim.lsp.buf #39446
Problem:
Currently, it only supports sending requests using the current cursor position as a parameter.

Solution:
Support sending requests using arbitrary positions.
2026-05-10 13:49:36 -04:00
Justin M. Keyes
1f4ad7808e docs: misc, window #39720
- formalize `window-number` similar to `tabpage-number`.
- reference it from docs.
2026-05-10 13:00:52 -04:00
Yi Ming
eb79cf5aee feat(logging): vim.log #38906 2026-05-10 11:03:15 -04:00
glepnir
2dc0efccb0 fix(snippet): cancel session on <Esc> in Select mode #39238
Problem: <Esc> in a Select-mode tabstop leaves the session and highlight active.
CursorMoved isn’t triggered since the cursor doesn’t move.

Solution: use ModeChanged (s:n) instead. Defer with vim.schedule() to avoid transient
s:n from jump().
2026-05-10 09:19:12 -04:00
Olivia Kinnear
5d1910e1e0 fix(luarc.json): increase workspace.preloadFileSize #39711
Problem:
When using the default `lua_ls` config from nvim-lspconfig, the following info message gets printed:

```
LSP[lua_ls] Too large file: src/nvim/eval.lua skipped. The currently set size limit is: 500 KB, and the file size is: 511.133 KB.
```

Solution:
Set `workspace.preloadFileSize` to 1000 KB instead of the default 500 KB.
2026-05-10 08:11:20 -04:00
Maria Solano
2acf27e5ff fix(diagnostic): handle signs = false in status() (#39703) 2026-05-09 17:59:21 -07:00
zeertzjq
2d5f56c0aa vim-patch:9.2.0461: Corrupted undofile causes use-after-free (#39707)
Problem:  The four pointer-resolution loops in u_read_undo() lack
          an i != j guard, so a header whose uh_next.seq equals
          its own uh_seq resolves uh_next.ptr to itself.  On
          buffer close, u_freeheader() sees uhp->uh_next.ptr !=
          NULL and skips updating b_u_oldhead, so u_blockfree()
          dereferences the freed header on the next iteration.
          The same pattern applies to uh_prev, uh_alt_next and
          uh_alt_prev.  A crafted .un~ file in the same directory
          as a text file can trigger the use-after-free and
          subsequent double-free when the buffer is closed.
          (Daniel Cervera)
Solution: Add an i != j guard to each of the four resolution
          loops, matching the guard already present in the
          duplicate-detection loop above.

closes: vim/vim#20168

Supported by AI

4f610f07b7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-10 08:06:07 +08:00
Will Lillis
b44c2bdd16 fix(treesitter): remove default match limit (#39696)
Problem: The default match limit of 256 can be too low for realistic
use cases, but was necessary to guard against catastrophic
performance cliffs.

Solution: Performance cliffs were fixed in upstream tree-sitter 0.27+,
so remove the fallback limit to return unlimited matches by default.
2026-05-09 10:19:21 +00:00
Christian Clason
ef84ec69aa fix(matchparen): remove redundant vimscript shim
Problem: #39625 retained `matchparen.vim` as a shim that sources the new
`matchparen.lua` entrypoint, which is redundant since Lua runtime/plugin
files are sourced automatically and incurs startuptime cost solely for
the sake of not touching the tests.

Solution: Remove the shim and `source` the Lua plugin in directly in
tests.
2026-05-09 10:01:40 +02:00
Nathan Zeng
db7f818728 refactor(defaults): use public treesitter select()
Problem: Default mappings use the private module.

Solution: Use the public method.
2026-05-09 10:00:03 +02:00
zeertzjq
ffe87d91f7 vim-patch:9.2.0458: Crash with invalid shellredir/shellpipe value (#39691)
Problem:  Crash with invalid shellredir/shellpipe value
          (bfredl)
Solution: Validate the option and allow only a single "%s".

fixes:  vim/vim#20157
closes: vim/vim#20159

84ae09dd79

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-09 01:13:19 +00:00
zeertzjq
91b9516d1b Merge pull request #39689 from zeertzjq/vim-9.2.0451
vim-patch:9.2.{0451,0454,0455}
2026-05-09 08:21:19 +08:00
zeertzjq
900975d30d vim-patch:9.2.0455: 'findfunc' only allows extra info for cmdline completion
Problem:  'findfunc' only allows extra info for cmdline completion, not
          for actually finding files (Maxim Kim, after 9.2.0451).
Solution: Handle returning a list of dicts when actually finding files.
          Also fix crash on NULL string (zeertzjq).

fixes:  vim/vim#20163
closes: vim/vim#20164

9694ff58fe
2026-05-09 08:05:56 +08:00
zeertzjq
3aa83dca41 vim-patch:9.2.0454: tests: no test that "abbr" in customlist completion is shown
Problem:  No test that "abbr" in customlist completion is shown in pum.
Solution: Add some "abbr" fields to the existing test (zeertzjq).

closes: vim/vim#20165

b207b5a2a3
2026-05-09 08:05:48 +08:00
zeertzjq
bf173c3e88 vim-patch:9.2.0451: 'findfunc' can't return extra info for cmdline completion
Problem:  'findfunc' can't return extra info for cmdline completion
          (Maxim Kim).
Solution: Handle 'findfunc' return value in cmdline completion like that
          of "customlist" functions (zeertzjq).

fixes:  vim/vim#20155
closes: vim/vim#20158

58124789aa
2026-05-09 08:05:46 +08:00
phanium
b7d8a41d91 build: strncat warning in buf_write #39684
To make gcc happy
```
src/nvim/bufwrite.c: In function ‘buf_write’:
src/nvim/bufwrite.c:1674:5: warning: ‘strncat’ specified bound depends
on the length of the source argument [-Wstringop-overflow=]
 1674 |     strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
      |     ^
src/nvim/bufwrite.c:1674:34: note: length computed here
 1674 |     strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
      |                                  ^
src/nvim/fileio.c: In function ‘filemess’:
src/nvim/fileio.c:137:5: warning: ‘strncat’ specified bound depends on
the length of the source argument [-Wstringop-overflow=]
  137 |     strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
      |     ^
src/nvim/fileio.c:137:34: note: length computed here
  137 |     strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
      |                                  ^
```
2026-05-08 14:47:00 -04:00
dependabot[bot]
27909a193d ci: bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.35.2 to 4.35.3
- [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.2...v4.35.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-08 15:00:04 +02:00
Evgeni Chasnovski
17335308eb fix(pack): suggest "delete" code action for active plugins #39678
Problem: Trying to execute code action on an active plugin without
  updates leads to nothing. It is more useful if code actions "do
  something" on a bigger portion of the confirm buffer.

Solution: Suggest "delete" code action even for active plugins. Trying
  to execute it will first show a confirmation buffer with relevant
  warning of why this might be not a good idea. Confirming will delete
  a plugin.
2026-05-08 12:26:40 +00:00
Justin M. Keyes
b813c7e082 Merge #39625 from ofseed/plugin-matchparen
refactor(matchparen): rewrite matchparen plugin in Lua
2026-05-08 06:19:07 -04:00
Yi Ming
f0f6753f30 refactor(matchparen): parameterize win instead of always using the current
AI-assisted: Codex
2026-05-08 17:17:03 +08:00
Yi Ming
523e679ead refactor(matchparen): rewrite matchparen plugin in Lua
AI-assisted: Codex
2026-05-08 17:17:03 +08:00
Luis Calle
416f3482e7 fix(vim.range): empty ranges semantics vs regular ranges #39474
Problem:
- Empty ranges have different `<`, `<=`, `has` and `intersect` semantics compared to regular ranges.
- `to_inclusive_pos` assumes that the end position of a range is exclusive, which is not true for empty ranges

Solution:
Special case empty ranges in these operations.
2026-05-08 05:17:00 -04:00
Alexej Kowalew
832a68835b fix(shell): preserve CR when :! outputs to binary-mode buffer #39558
Problem:
When `:!` writes shell output to a buffer, write_output() splits on `\r`, `\n`,
and `\r\n`, replacing the terminator byte with NUL. For a binary-mode buffer
this is wrong: `\r` should be preserved verbatim, not treated as a line
terminator. This wrong behavior causes a file like `\r\n` round-trips through
`:%!cat` to `\n`.

This was masked when 'shelltemp' was enabled, because output went through a temp
file and the regular file I/O path handled binary-mode correctly. Switching the
default to 'noshelltemp' exposed the bug, since output is now piped directly
into write_output().

Solution:
In `write_output()`, skip the `\r` and `\r\n` splits for a binary-mode buffer;
only split on `\n`.
2026-05-08 03:54:30 -04:00
Nathan Zeng
a61c8f3580 refactor(test): use public enum in select_spec #39665
Problem: select_spec tests a public function, but uses private enums.

Solution: Replace private enums with public enums.
2026-05-08 03:38:35 -04:00
zeertzjq
0976ce255b vim-patch:9.2.0450: [security]: heap buffer overflow in spellfile.c read_compound() (#39660)
Problem:  read_compound() in spellfile.c computes the size of the regex
          pattern buffer using signed-int arithmetic on the attacker
          controlled SN_COMPOUND sectionlen.  With sectionlen=0x40000008
          and UTF-8 encoding active the multiplication wraps to 27 while
          the per-byte loop writes up to ~1B bytes, overflowing the heap.
          Reachable when loading a crafted .spl file (e.g. via 'set spell'
          after a modeline sets 'spelllang').  The cp/ap/crp allocations
          have the same int + 1 overflow class (Daniel Cervera)
Solution: Use type size_t as buffer size and reject values larger than
          COMPOUND_MAX_LEN (100000).  Apply the same size_t treatment to
          the cp/ap/crp allocations.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q4jv-r9gj-6cwv

9299332917

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 23:03:20 +00:00
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