Commit Graph

35692 Commits

Author SHA1 Message Date
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
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
Ayaan
a2f01953b8 fix(terminal): free the "[Process exited]" msg extmark #38246
Problem: Since the "[Process exited]" msg is no longer part of buffer
contents, `jobstart`'s reuse of unmodified finished terminal buffers
does not clear the msg.

Solution: Delete the extmark if `term` is already closed.
2026-03-11 05:13:38 -04:00
zeertzjq
b897e81b30 test(api/vim_spec): fix flaky test (#38227)
Problem:
Exit code in :terminal channel test depends on whether the shell or Nvim
TUI in the terminal has registered its SIGHUP handler when jobstop() is
called.

Solution:
Don't use a shell as shells on different systems may handle SIGHUP
differently. Add a screen:expect() to wait for the TUI to start.
2026-03-11 10:12:24 +08:00
zeertzjq
ddccf882ff vim-patch:c6f6f16: runtime(toml): update syntax script and fix highlight of dates and escapes (#38239)
From upstream:
https://github.com/cespare/vim-toml/pull/69
https://github.com/cespare/vim-toml/pull/70

closes: vim/vim#19591

c6f6f1602d

Co-authored-by: Martin Tournoij <martin@arp242.net>
2026-03-11 08:16:14 +08:00
zeertzjq
3a7ade847f vim-patch:9.2.0132: tests: Test_recover_corrupted_swap_file1 fails on be systems (#38238)
Problem:  tests: Test_recover_corrupted_swap_file1 fails on big-ending
          systems (after v9.2.0077)
Solution: Skip the test on big-endian systems (James McCoy)

The POC files were generated on 64-bit little-endian systems and
therefore are not portable to any other system type.

Extract the 64-bit / endianness detection from
Test_recover_corrupted_swap_file() into a SetUp() function and use that
data to determine if the test should be run.

closes: vim/vim#19620

ff16ebdb08

Co-authored-by: James McCoy <jamessan@debian.org>
2026-03-11 07:48:36 +08:00
Commrade Goad
66066d0f6a fix(lua): extra CR (\r) in nvim -l output #38048
Problem:
`nvim -l` prints an extra `\r` to stdout:

    :=vim.system({'cmd', '/c',  "echo print(1) | nvim -l -"}, {}):wait()
    {
      code = 0,
      signal = 0,
      stderr = "1\r\r\n",
      stdout = ""
    }

Solution:
Check `headless_mode` in `msg_use_crlf`.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-10 19:01:45 -04:00
glepnir
e23c083d13 fix(highlight): avoid null deref, misc issues #38164
Problem: update_window_hl dereferenced the pmap_get result without a
NULL check. Also `tmp` had the wrong type and attr_id==0 was rejected
twice.

Solution: check the pointer before dereferencing, change `tmp` to
bool, and update the attr_id check to `< 0`.
2026-03-10 18:17:02 -04:00
Justin M. Keyes
2c5266429c Merge #37926 msg_show UI event indicates user-interactive 2026-03-10 17:53:11 -04:00
MP430
b3324be0d8 fix(man.lua): :Man ignores section of gzipped manpage #38235
Problem:
Under certain circumstances (e.g. gzipped manpages with mandoc),
:Man will not find the correct page because it does not process
multiple extensions correctly.
For example, with a file named strcpy.3p.gz, it will only check the .gz
part to try to check the section.
This leads to some pages being inaccessible because it will return the
page from the wrong section.

Solution:
Loop and try multiple extensions to try to find one which matches
the name of the section.
Also refactor the man.get_path function so that it can be tested.
2026-03-10 17:26:40 -04:00
glepnir
145548a24a feat(lsp): show snippet preview if completeopt=popup #32553
Problem:
LSP completion does not show snippet preview.

Solution:
Show snippet preview if 'completeopt' includes popup.
2026-03-10 14:34:58 -04:00
Daniel Hast
fc90585095 ci: Zizmor GHA security analysis #38230
Add workflow that runs Zizmor, a static analysis tool for GitHub
Actions. This will automatically flag various common security issues
with CI workflows.
2026-03-10 11:57:18 -04:00
luukvbaal
b47b0caba8 fix(message): concatenate multi-chunk nvim_echo({err}) for exception message #38131
Problem:  Exception error message only prints the first chunk of a
          multi-chunk nvim_echo() message.
Solution: Concatenate consecutive message chunks in the exception
          message list.
2026-03-10 10:35:24 -04:00
Ayaan
c8693051a8 feat(terminal): surface exit code via virttext + nvim_get_chan_info #37987
Problem:
When a terminal process exits, "[Process Exited]" text is added
to the buffer contents.

Solution:
- Return `exitcode` field from `nvim_get_chan_info`.
- Show it in the default 'statusline'.
- Show exitcode as virtual text in the terminal buffer.
2026-03-10 08:02:50 -04:00
Yi Ming
0cc4f53b40 fix(lsp): do not clear the codelens on the last line #38226
Problem
The logic that clears codelenses beyond the buffer also removes the codelenses on the last line.

Solution
Do not clear the codelens on the last line.
2026-03-10 07:36:29 -04:00
Kyle
5b5b7eb8d4 fix(tui): reset cursor to default style when guicursor is disabled #38219
Problem:
Cursor style is not set to default when guicursor is disabled. See
return early when guicursor is disabled (rather than resetting the
cursor style to terminal default).

Solution:
Send the appropriate DECSCUSR sequence to reset the cursor style when
guicursor is disabled.

Note that this does not fix #23122. The CSI sequence sent out depends on
the terminal in question. Ideally, it would would send `\x1b[0 q` to
reset the cursor style; the behavior of this sequence depends on the
terminal and configuration in question. See [Ghostty
docs](https://ghostty.org/docs/vt/csi/decscusr) for more details.

In practice, it sends out `\x1b[2 q` (steady block) for Ghostty, which
seems to be coming from the Unibilium database. I'm not sure what it may
send out for other terminals, but it doesn't exactly reset to the
default style.
2026-03-10 07:03:02 -04:00
Justin M. Keyes
4fb0f95330 Merge #38196 ci: fix issues flagged by Zizmor 2026-03-10 06:47:18 -04:00
zeertzjq
c1dcb8dac2 vim-patch:9.2.0131: potential buffer overflow in regdump() (#38217)
Problem:  Potential buffer overflow in regdump()
Solution: Add the size to the compiled regular expression and ensure we
          don't read over the limit.

Note: this is not a security issue, because regdump() is typically not
compiled in any version of Vim, so should not affect anybody.

supported by AI claude.

9360647715

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-10 10:47:07 +08:00
Daniel Hast
ed767a6a69 ci: ignore known Zizmor findings
This avoids false positives from existing uses of `GITHUB_ENV` and
`pull_request_target` that are safe, as well as from cache usage in a
workflow that doesn't produce release artifacts.
2026-03-09 21:40:50 -04:00
Daniel Hast
3572bf7e16 ci: eliminate template expansion in code contexts
Replace all template expansions in code contexts with environment
variable substitutions. Template expansion in code contexts can be a
source of code injection vulnerabilities; for more info, see:
https://docs.zizmor.sh/audits/#template-injection
2026-03-09 21:40:39 -04:00
Daniel Hast
755087f8ef ci: set default permissions for workflows
The default workflow permissions are overly broad; setting permissions
explicitly at the workflow level ensures excessive permissions are not
unintentionally granted to jobs. For details, see:
https://docs.zizmor.sh/audits/#excessive-permissions
2026-03-09 21:36:20 -04:00
Daniel Hast
63844b7904 ci: don't persist git credentials on disk
Set `persist-credentials: false` for all uses of `actions/checkout`.
This prevents git credentials from being stored on disk, and fixes the
following Zizmor audit:
https://docs.zizmor.sh/audits/#artipacked
2026-03-09 21:36:20 -04:00
Daniel Hast
d1314018cc ci: pin third-party action dependencies to commit hashes
This improves CI security by ensuring that action dependencies cannot be
changed by upstream repositories without updating the use of the
dependency in this repo.

Official GitHub-maintained actions are excluded from this requirement
and are left pinned by a tag instead of a commit hash. This action
dependency pinning policy is codified in `.github/zizmor.yml` so that
Zizmor (a static analysis tool for GitHub Actions) doesn't flag these as
unpinned dependencies.

Also add cooldown timer for Dependabot. This fixes these two Zizmor
audits:
* https://docs.zizmor.sh/audits/#dependabot-cooldown
* https://docs.zizmor.sh/audits/#unpinned-uses
2026-03-09 21:36:20 -04:00
zeertzjq
9734a6ce47 vim-patch:9.2.0130: missing range flags for the :tab command (#38216)
Problem:  :tab accepts a tab address range but doesn't specify this in
          the command specification.
Solution: Add EX_RANGE and EX_ZEROR to the command specification and use
          ADDR_TABS (Doug Kearns).

As command modifers are handled separately before these flags are tested
in the ex-command parser they have no effect.  However, it's better to
use an accurate description and the command specification table has uses
in other areas like runtime file generation for the Vim filetype.

closes: vim/vim#19100

49b8d9903b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-10 09:15:52 +08:00
zeertzjq
29fa072b34 vim-patch:partial:9.2.0126: String handling can be improved (#38214)
Problem:  String handling can be improved
Solution: Pass string length where it is known to avoid strlen() calls,
          do a few minor refactors (John Marriott).

This commit changes some calls to function `set_vim_var_string()` to pass
the string length where it is known or can be easily calculated.

In addition:
In `evalvars.c`:
  * In function `set_reg_var()` turn variable `regname` into a C string
    because that is how it used.
  * Small cosmetics.
In `option.c`:
  * Slightly refactor function `apply_optionset_autocmd()` to move some
    variables closer to where they are used.
In `getchar.c`:
  * Slightly refactor function `do_key_input_pre()`:
    -> change call to `dict_add_string()` to `dict_add_string_len()` and
       pass it the length of `buf`.
    -> only call `get_vim_var_string()` once.
In `message.c`:
  * Use a `string_T` to store local variable `p`.
In `normal.c`:
  * Move some variables closer to where they are used.

closes: vim/vim#19618

727f6e2686

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-03-10 09:13:30 +08:00
luukvbaal
a81b059a45 fix(messages): non-fast and append for "shell_*" kinds #38188
Problem:  vim.ui_attach() is unable to display streamed shell output,
          and will display it as individual messages.
          Unwanted newlines in "shell_ret" message.
Solution: Treat the "shell_*" kinds as non-fast and set msg_show->append
          for the streamed stdout/err messages.
          Remove leading newline from (translated) message with
          ext_messages, remove trailing newline altogether.
2026-03-09 19:24:01 -04:00
Stefan Novaković
bffca6e26b feat(extmark): support end_col=-1 if strict=false #28169
Problem:
There is an inconsistency between extmarks/highlights regarding the
`end_col` param.

Solution:
Allow end_col=-1 to mean "end of line" (if strict=false).

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-09 19:20:25 -04:00
Justin M. Keyes
dce8bdd247 Merge #38117 from noib3/fix-lua-lints-in-src 2026-03-09 18:16:01 -04:00
Riccardo Mazzarini
92b2a26772 fix: resolve all remaining LuaLS warnings in src/ 2026-03-09 21:47:15 +01:00
Riccardo Mazzarini
9204b7541d fix: silence LuaLS's no-unknown warnings in src/ 2026-03-09 21:47:15 +01:00
Riccardo Mazzarini
7fdf9f7399 fix: define vim.mpack
We define vim.mpack so that LuaLS doesn't emit undefined-field warnings
when using it, annotated with @nodoc to skip doc generation.
2026-03-09 21:47:13 +01:00
Riccardo Mazzarini
71829510b9 refactor: make LuaLS run diagnostics on all files in src/
Not just files open in an editor
2026-03-09 21:26:11 +01:00
Justin M. Keyes
3b94ab296f Merge #38206 nvim_win_set_config 2026-03-09 15:56:24 -04:00