Commit Graph

35723 Commits

Author SHA1 Message Date
altermo
39fa5e8ba9 docs(treesitter): fix typo 2026-03-14 12:25:14 +01:00
glepnir
5653b25e9b fix(lsp): handle non-string documentation in completion items #38291
Problem: `get_doc` throws error with "attempt to get length of a userdata
value" when `item.documentation` is truthy but not a string (e.g. vim.NIL
from a JSON null).

Solution: Check `type(item.documentation)` before taking its length.
2026-03-14 05:20:34 -04:00
Sean Dewar
b4e3461e3f fix(window): don't leak fold memory with style=minimal #38287
Problem: discarding saved option values in the WinInfo of closed style=minimal
windows leaks memory.

Solution: also free the nested folds.
2026-03-14 05:18:21 -04:00
github-actions[bot]
ab05b58b88 docs: update version.c #38222
vim-patch:9.2.0128: Wayland: using _Boolean instead of bool type
vim-patch:9.2.0133: memory leak in netbeans_file_activated()
vim-patch:9.2.0136: memory leak in add_interface_from_super_class()
vim-patch:1429277f0 gitattributes: mark dump files as linguist-generated
vim-patch:9.2.0154: if_lua: runtime error with lua 5.5
vim-patch:9.2.0157: Vim9: concatenation can be improved
vim-patch:9.2.0141: :perl ex commands allowed in restricted mode
vim-patch:9.2.0142: Coverity: Dead code warning
vim-patch:9.2.0146: dictionary lookups can be improved
vim-patch:9.2.0148: Compile error when FEAT_DIFF is not defined
vim-patch:9.2.0156: perleval() and rubyeval() ignore security settings
2026-03-14 05:09:58 -04:00
zeertzjq
f58d24040a vim-patch:9.2.0155: filetype: ObjectScript are not recognized (#38288)
Problem:  filetype: ObjectScript are not recognized
Solution: Add ObjectScript filetype detection for *.cls files
          (Hannah Kimura)).

Reference:
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_intro

closes: vim/vim#19668

b11c8efbe6

Co-authored-by: Hannah <hannah.kimura@intersystems.com>
2026-03-14 01:42:10 +00:00
zeertzjq
d3bca3b7fa vim-patch:9.2.0152: concatenating strings is slow (#38286)
Problem:  concatenating strings is slow
Solution: Use grow_string_tv() to grow the existing string buffer in
          place when possible (Yasuhiro Matsumoto).

closes: vim/vim#19642

16d421a4d9

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-03-14 08:14:34 +08:00
nikolightsaber
fd1e019e90 refactor(treesitter)!: get_parser return nil on error #37276 2026-03-13 15:57:36 -04:00
Justin M. Keyes
8499af1119 Merge #38268 docs: misc 2026-03-13 15:37:12 -04:00
Justin M. Keyes
017d8aa298 refactor: rename _ensure_integer => _assert_integer 2026-03-13 20:32:01 +01:00
Justin M. Keyes
682c77805c docs: misc 2026-03-13 20:32:01 +01:00
luukvbaal
911337eb3c fix(normal): crash using :norm from vim.ui_attach shell message event #38283
Problem:  'showcmd' buffer is being populated for :norm commands, which
          can result in a recursive uv_run() when called from a msg_show
          vim.ui_attach callback for a shell message.

Solution: The 'showcmd' buffer is never displayed while executing a
          :normal command so prevent unnecessary work, avoiding the crash.
2026-03-13 09:36:44 -04:00
Justin M. Keyes
f51c54ace6 build: noisy readability-implicit-bool-conversion warning #38282
Problem:
clangd shows `Implicit conversion 'int' -> 'bool'` warnings.
This is mostly noise in this codebase.

Solution:
- Disable the warning.
- Get latest clang-tidy in CI.
2026-03-13 09:02:22 -04:00
Lewis Russell
6766e6104f ci: label disclosed AI-assisted PRs
Add a simple AGENTS.md rule for the AI-Assisted trailer in commit
messages and a workflow that adds the AI assisted label when PR commits
include that trailer.

AI-Assisted: Codex
2026-03-13 12:29:44 +00:00
Justin M. Keyes
9d052ddc79 test: set NVIM_TEST in zig build #38281
Problem:
Noise in zig CI logs:

    WRN 2026-03-13T03:12:58.742 ui/c/T140.75243.0 tui_handle_term_mode:239: TUI: terminal mode 69 detected, state 2
    WRN 2026-03-13T03:12:58.743 ui/c/T140.75243.0 tui_handle_term_mode:226: TUI: terminal mode 2026 unavailable, state 0
    WRN 2026-03-13T03:12:58.743 ui/c/T140.75243.0 tui_handle_term_mode:226: TUI: terminal mode 2027 unavailable, state 0

Solution:
Set NVIM_TEST.

Followup to d6bee7e407
2026-03-13 07:33:03 -04:00
Oleh Volynets
caf7808591 feat(diagnostic): custom status format function #36696
Problem:  Statusline component of diagnostics allows only the default
          format "sign:count".

Solution: Extend vim.diagnostic.Opts.Status to allow a custom signs
          or formatting function that provides the status presentation.
2026-03-13 07:21:45 -04:00
glepnir
7b8deacc3f fix(ui): preview float doesn't respond to mouse scroll #38270
Problem: The floating preview window (e.g. completion info)
has mouse=false, so scroll wheel events pass right through it.

Solution: Set mouse=true on the preview float so users can
scroll its content with the mouse wheel.
2026-03-13 06:17:10 -04:00
glepnir
3f10bb87ef fix(completion): wrong CompleteDone reason for auto-inserted sole match #38280
Problem: #38169 used compl_used_match to determine the CompleteDone
reason, but this fires too broadly, it also changes the reason to
"accept" when the popup was shown and the user dismissed it with <Esc>
or <Space>, breaking snippet completion with autocomplete.

Solution: Instead of checking compl_used_match in, check whether the pum
was never shown (compl_match_array == NULL) in ins_compl_stop().
When a match was inserted but the pum never displayed,
set the completed word so CompleteDone fires with reason "accept".
This keeps the "discard" reason intact when the user dismisses a visible
pum without confirming.
2026-03-13 06:13:58 -04:00
glepnir
f3ec657ebc fix(api): nvim_parse_cmd on range-only, modifier-only commands #36665
Problem: nvim_parse_cmd rejects valid commands like `:1` (range-only)
or `aboveleft` (modifier-only).

Solution: allow empty command when range or modifiers exist, and handle
execution using existing range command logic.
2026-03-13 06:06:39 -04:00
zeertzjq
b027de3a87 test: include :cd in pcall() in rmdir() (#38278)
If the Nvim session has exited, the nvim_command will fail too.

ERROR    test/functional/core/fileio_spec.lua @ 342: tmpdir failure modes
test\functional\testnvim.lua:133: sending request after EOF from Nvim

stack traceback:
	test\functional\testnvim.lua:133: in function 'command'
	test\functional\testnvim.lua:847: in function 'rmdir'
	test/functional/core\fileio_spec.lua:353: in function <test/functional/core\fileio_spec.lua:342>
2026-03-13 08:06:24 +08:00
zeertzjq
957eb1fde0 vim-patch:3697c6b: runtime(ssh): ignore case in 'keywordprg', update syntax script (#38277)
- ftplugin(sshdconfig): use "-I" for 'keywordprg' to search
  case-insensitive in the man page
- syntax(sshdconfig,sshconfig): Mark "lowdelay", "throughput", and
  "reliability" as deprecated for IPQoS, highlighting them as
  errors/warnings to reflect OpenSSH 10.1p1 release

Reference:
https://www.openssh.org/releasenotes.html#10.1p1

closes: vim/vim#19636

3697c6b020

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-12 23:45:04 +00:00
zeertzjq
878c9739e1 vim-patch:9.2.0147: blob: concatenation can be improved (#38276)
Problem:  blob: concatenation can be improved
Solution: Use ga_grow() to allocate space once and mch_memmove() to copy
          the blob data as a single block and fall back to the previous
          byte by byte append (Yasuhiro Matsumoto).

closes: vim/vim#19645

67deae3b77

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-03-12 23:28:26 +00:00
luukvbaal
52dd62aa6e fix(ui2): use pager to list consecutively typed commands #38272
Problem:  Mimicked block mode for cmdline entered while expanded
          does not work intuitively for repeated commands yielding
          messages exceeding the screen height. The expanded cmdline
          resizes and scrolls to bottom/top when appending a message
          and entering the cmdline. Also includes the entered command,
          as opposed to the UI1 behavior.
          Crash when scrolling to bottom of pager due to recursive
          uv_run after shell message callback executes `nvim_command()`
          with 'showcmd'.

Solution: Still mimic block mode when entering the expanded cmdline,
          but when the entered command emits a message open the pager
          with the current message content in the expanded cmdline.
          Always route typed commands to the pager when it is open.
          Use `nvim_buf_set_cursor()` instead of `nvim_command()`.
2026-03-12 18:38:39 -04:00
Lewis Russell
ce1154048b refactor: integer functions, optimize asserts #34112
refactor(lua): add integer coercion helpers

Add vim._tointeger() and vim._ensure_integer(), including optional base
support, and switch integer-only tonumber()/assert call sites in the Lua
runtime to use them.

This also cleans up related integer parsing in LSP, health, loader, URI,
tohtml, and Treesitter code.

supported by AI
2026-03-12 11:04:05 -04:00
Justin M. Keyes
2fe07cc965 Merge #37815 do_highlight change-detection of "gui" colors 2026-03-12 10:16:18 -04:00
Justin M. Keyes
9a5abf0277 Merge #38259 docs 2026-03-12 06:51:35 -04:00
Justin M. Keyes
7ea148a1dc docs: use "ev" convention in event-handlers
Problem:
In autocmd examples, using "args" as the event-object name is vague and
may be confused with a user-command.

Solution:
Use "ev" as the conventional event-object name.
2026-03-12 11:12:56 +01:00
Justin M. Keyes
bc67976c95 docs: vimfn descriptions 2026-03-12 11:12:56 +01:00
Justin M. Keyes
96e6ce6619 docs: misc 2026-03-12 11:12:56 +01:00
glepnir
d87972f920 fix(pum): keep info window aligned with pum when above #38251
Problem:
When `pum_above` is set, the info window uses `anchor=SW`. Updating the
info window height during `CompleteChanged` causes its top edge to shift,
so it no longer aligns with the top of the pum.

Solution:
Use `NW` as the anchor even when `pum_above` is true so the info window
remains aligned with `pum_row`.
2026-03-12 05:48:14 -04:00
Willaaaaaaa
c5146362d8 test: fs_spec fails if home is a symlink #38258 2026-03-12 05:46:18 -04:00
anondeveg
32aee065a8 feat(startup): warn if NVIM_LOG_FILE is inaccessible #38070
Problem:
If NVIM_LOG_FILE, or the default fallback, is inaccessible (e.g.
directory is owned by root), users get confused.

Solution:
Show a warning when $NVIM_LOG_FILE or $XDG_STATE_HOME are inaccessible.

Also fix a latent memory leak: `os_mkdir_recurse` returns a uv error
code (int), but it was stored as `bool`, causing `os_strerror` to
receive an invalid error code and leak memory.

See: https://docs.libuv.org/en/v1.x/errors.html#c.uv_strerror

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-12 04:40:07 -04:00
glepnir
d7903982ae refactor(highlight): extract set_gui_color() from do_highlight()
Problem: GUIFG, GUIBG, GUISP handling in do_highlight() is basically
the same code copy-pasted three times.

Solution: Pull the shared logic into a small set_gui_color() helper.
2026-03-12 14:25:14 +08:00
glepnir
d5a8c9d766 fix(highlight): correct change detection in do_highlight for gui colors
Problem: The GUIFG/GUIBG/GUISP handlers compare sg_rgb_{fg,bg,sp}
(RgbValue) against old_idx (color table index) instead of comparing
sg_rgb_{fg,bg,sp}_idx against old_idx, making did_change unreliable.

Solution: Use the _idx field for the index comparison and add the
missing sg_rgb_sp_idx assignment.
2026-03-12 14:25:14 +08:00
zeertzjq
f847aa6208 vim-patch:9.2.0140: file reading performance can be improved (#38266)
Problem:  Reading large files is slow because UTF-8 validation and
          newline scanning are performed byte-by-byte. Initial file
          loading also triggers listener and channel processing.
Solution: Use memchr() for SIMD-optimized newline scanning, implement
          word-at-a-time ASCII skipping during UTF-8 validation using a
          bitmask, skip listener/netbeans/channel notifications
          when the ML_APPEND_NEW flag is set during readfile()
          (Yasuhiro Matsumoto).

closes: vim/vim#19612

2ca96b09d7

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Co-authored-by: NRK <nrk@disroot.org>
2026-03-12 10:28:03 +08:00
zeertzjq
692f882052 ci: fix broken workflows after Zizmor fixes (#38264)
- Backport workflow needs to use the credentials.
- Release workflow can specify the credentials on the command line.
2026-03-12 08:54:36 +08:00
zeertzjq
99a0b2f7b8 vim-patch:2cf18fc: runtime(python): Update syntax, improve pythonNumber pattern performance (#38263)
- Improve the performance of all pythonNumber patterns by unrolling
  digit/underscore sequence loops.
- Split the float literal pattern into two simpler patterns.

fixes:  vim/vim#19625 (Reported by James McCoy)
closes: vim/vim#19630

2cf18fcc24

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-12 07:55:00 +08:00
zeertzjq
4558fc02de vim-patch:8f2cd47: runtime(sudoers): update filetype plugin and syntax script (#38262)
- remove `set isk+=-` to highlight `-=` operator correctly
- implement highlighting of GID
- fix highlight of hostname and add special value ALL
- fix highlight of IP address
- update include and includedir patterns
- remove duplicate syntax rules
- add missing options
- fix highlight of parameter assignment (limit operators to list
  parameters)
- fix highlight of string and list parameters with trailing whitespaces
- implement highlight of permission (octal)
- implement highlight of floating point numbers
- implement highlight of timeout-specific options
- support highlight of negatable options (integer, mode, float, timeout,
  string)
- allow sudoersListParameter to be negated
- fix highlight of comma-separated parameter list used as boolean
- fix highlight of parameter negation (prevent highlighting ill-formed `! !`)
- fix highlight of Tag_Spec
- allow empty Runas spec: `()` and `(:)`
- fix highlight of comma-concatenated commands, hosts, and users
- check word boundaries for special value ALL
- implement highlight of Option_Spec
- fix highlight in User_Spec (specifically for Host position)
- fix highlight of `Default!` command
- support highlight of digests (sha224, etc.)
- add syntax test and update header

closes: vim/vim#19634

8f2cd47404

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-12 07:54:48 +08:00
zeertzjq
e5667b9c15 vim-patch:9.2.0137: [security]: crash with composing char in collection range (#38261)
Problem:  Using a composing character as the end of a range inside a
          collection may corrupt the NFA postfix stack
          (Nathan Mills, after v9.1.0011)
Solution: When a character is used as the endpoint of a range, do not emit
          its composing characters separately. Range handling only uses
          the base codepoint.

supported by AI

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-9phh-423r-778r

36d6e87542

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-11 23:42:31 +00:00
zeertzjq
974bc1b044 fix(process): wrong exit code for SIGHUP on Windows (#38242)
Problem:
When stopping a PTY process on Windows, the exit code indicates that the
process is stopped by SIGTERM even when closing all streams is enough to
terminate the process. This is inconsistent with other platforms.

Solution:
Set exit_signal to SIGHUP instead of SIGTERM when using SIGHUP.
2026-03-12 06:45:22 +08:00
Rawan Khalid
8aacce90b4 fix(cmake): linker flags, doc generation for cross-compilation #38215
Problem:
Cross-compilation issues encountered when building Neovim for WASM.
When cross-compiling, three issues occur:
1. `-Wl,--no-undefined` — not supported by `wasm-ld` 
2. `-lutil` — not available in the Emscripten sysroot
3. Doc generation fails because CMake tries to execute `$<TARGET_FILE:nvim_bin>` on the host machine, which fails because the binary is not native to the host. It fails with `/bin/sh: nvim.js: Permission denied`

Solution:
The fix includes skipping `-Wl,--no-undefined` and `-lutil` with `NOT CMAKE_CROSSCOMPILING` and adding `NVIM_HOST_PRG` variable to `runtime/CMakeLists.txt` so when cross-compiling, it uses a host native nvim binary for doc generation instead of using the cross-compiled target.
2026-03-11 19:05:46 +00:00
Willaaaaaaa
689a149b08 fix(prompt): don't implicitly set 'modified' #38118
Problem:
In aec3d7915c Vim changed prompt-buffers
to respect 'modified' so the termdebug plugin can "control closing the
window". But for most use-cases  (REPL, shell, AI "chat", …),
prompt-buffers are in practice always "modified", and no way to "save"
them, so *implicitly* setting 'modified' is noisy and annoying.

Solution:
Don't implicitly set 'modified' when a prompt-buffer is updated.
Plugins/users can still explicitly set 'modified', which will then
trigger the "E37: No write since last change" warning.
2026-03-11 14:16:35 -04:00
glepnir
f168d215cf fix(lsp): ensure augroup before querying autocmds #38254 2026-03-11 13:57:19 -04:00
Justin M. Keyes
ba0baea620 Merge #37830 docs 2026-03-11 13:39:39 -04:00
Justin M. Keyes
682f5fee60 docs: misc
Close #37458
Close #37838
Close #37840
Close #37872
Close #37890
Close #38016
Close #38051
Close #38189
Close #38225
Close #38243
Close #38250

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com>
Co-authored-by: Austin Rambo <ramboaustin13@gmail.com>
Co-authored-by: Jonathan Birk <1965620+cafce25@users.noreply.github.com>
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com>
Co-authored-by: Saad Nadeem <saadndm.sn@gmail.com>
Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Yi Ming <ofseed@foxmail.com>
2026-03-11 18:24:57 +01:00
Justin M. Keyes
a3058abf30 docs: deprecate hit-enter 2026-03-11 18:17:46 +01:00
Justin M. Keyes
b8a976afda docs: api, messages, lsp, trust
gen_vimdoc.lua: In prepare for the upcoming release, comment-out the
"Experimental" warning for prerelease features.
2026-03-11 18:00:18 +01:00
zeertzjq
0ced216927 test(ex_cmds/mksession_spec): fix possible error log (#38255)
Problem:  :terminal CWD restoration test may lead to an error log if
          after_each() runs before the PTY process calls chdir().
Solution: Wait for some time before wiping the buffer, which can also
          prevent SIGHUP being sent to the parent.
2026-03-11 22:45:32 +08:00
Justin M. Keyes
4aeeaa8027 docs: usr_25.txt formatting
fix https://github.com/neovim/neovim.github.io/issues/453
2026-03-11 12:39:49 +01:00
luukvbaal
e1b3ca6629 fix(compositor): clear old position with last known dimensions #38229
Problem:  When reconfiguring a float reallocates the grid before the old
          area is cleared, artifacts are left on the screen.
Solution: Use the last known compositor dimensions of a grid when
          clearing the area covered by the old position.

Co-authored-by: glepnir <glephunter@gmail.com>
2026-03-11 07:38:18 -04:00
glepnir
63594ffa04 feat(lsp): do completionItem/resolve if completeopt=popup #32820
Problem:
No completionItem/resolve handler.

Solution:
If completeopt=popup is set, invoke completionItem/resolve when
a completion item is selected. Show resolved documentation in popup next
to the completion menu.
2026-03-11 05:48:31 -04:00