35298 Commits

Author SHA1 Message Date
zeertzjq
6ad73421cb vim-patch:b422a33: runtime(gdb): Update syntax and ftplugin (#37783)
- Change syntax file maintainer.
- Add Guile and Python command highlighting.
- Update command list to version 12.
- Add foldable regions for the commands 'define', 'if' and 'while'
  multiline commands.
- Support documented partial command names.
- Add matchit, browsefilter, and comment formatting support.
- Support embedded C in compiler {code|print} commands.
- Add largely complete settings highlighting and folding.
- Add syntax tests (incomplete).

Thanks to Claudio Fleiner for many years of maintenance.

closes: vim/vim#10649

b422a33ac2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-09 00:19:39 +00:00
Sean Dewar
19379d1255 fix(autocmd): deferred TermResponse lacks "data", may not fire (#37778)
Problem: TermResponse deferred due to blocked autocommands lacks "data" payload.
Also, it may not fire if a new v:termresponse reuses the same string address.

Solution: add it. Use the value of v:termresponse for "data.sequence". Replace
pointer comparisons with a flag.

The removal of "old_termresponse" comparisons is required to pass the test on
the CI, or locally for me when compiled in RelWithDebInfo.
2026-02-08 21:43:50 +00:00
Tomasz N
eaacdc9bdf fix(lsp): ignore empty response on trigger completion #37663
Problem:
Empty response affects server start boundary computed before.

Solution:
Ignore empty responses. This is mostly micro-optimization that avoids
extending existing results with empty responses.
2026-02-08 16:25:47 -05:00
GenchoXD
9c8d06e086 test(lsp/diagnostic): clearing diagnostics #37759
Problem:
Diagnostic lifecycle invariants (clearing on empty publish and buffer
deletion) were previously implicit and not directly covered by functional
tests, allowing regressions to go unnoticed.

Solution:
Add functional regression tests asserting that diagnostics are cleared
when an LSP server publishes an empty diagnostic set and when the
associated buffer is deleted. Assertions are scoped to the client
diagnostic namespace and use public diagnostic APIs only.
2026-02-08 16:22:13 -05:00
Mike J McGuirk
15ff454443 feat(lsp): display codelens as virtual lines, not virtual text #36469
Problem: Code lenses currently display as virtual text on the same line
and after the relevant item. While the spec does not say how lenses
should be rendered, above the line is most typical. For longer lines,
lenses rendered as virtual text can run off the side of the screen.

Solution: Display lenses as virtual lines above the text.

Closes https://github.com/neovim/neovim/issues/33923

Co-authored-by: Yi Ming <ofseed@foxmail.com>
2026-02-08 16:10:41 -05:00
Sean Dewar
1519a34e43 fix(terminal): autocmds leave terminal open to wiped buffer
Problem: if buf_free_all autocommands open a terminal, it will remain open after
the buffer is freed.

Solution: close terminals again later, this time while blocking autocommands.

Did consider terminal_open checking stuff like b_locked_split instead, but
that's set during BufHidden, etc., which doesn't mean the buffer's being wiped.
2026-02-08 16:12:00 +00:00
Sean Dewar
da8de99d0b fix(window): use real last buffer of closed window
Problem: close_buffer autocmds may switch buffers at the last moment when
closing a window, causing terminal_check_size to prefer the size of a closed
window, or TabClosed to set an old <abuf>.

Solution: use the actual last buffer, similar to what TabClosed did before.

NOTE: If buffer was unloaded/deleted (not wiped), then TabClosed's <abuf> may
not use it. (w_buffer = NULL) Maybe odd, but it's how it worked before anyhow.

Relies on close_buffer reliably setting w_buffer to NULL if freed, otherwise
buf_valid is better. Only concern I see is if the window wasn't in the window
list after closing the buffer (close_buffer won't set it to NULL then), but then
win_close{_othertab} should've returned earlier.
2026-02-08 16:12:00 +00:00
Sean Dewar
d945a93d69 fix(autocmd): potential TabClosed UAF, always set abuf
Problem: win_free_mem can free w_buffer (via qf_free_all), which may cause a
heap use-after-free if used as TabClosed's <abuf>. I think TabClosed is also the
only event to conditionally set <abuf> not based on event type.

Solution: use the buffer saved by the bufref. Fall back to curbuf if invalid,
like WinResized/WinScrolled.

NOTE: Not always equivalent if close_buffer autocmds switch buffers at the last
moment; previously <abuf> would be set to that buffer. Fixed in next commit.

https://github.com/neovim/neovim/actions/runs/21765657455/job/62800643599?pr=37758#step:9:159
for an example of qf_free_all being a nuisance.
2026-02-08 16:12:00 +00:00
Sean Dewar
5c156fdc64 fix(terminal): update size after closing window
Problem: terminal's size may not update after one of its windows close.

Solution: call terminal_check_size after closing a window.

Disable test for Windows, as for some reason it only shows a few lines...
2026-02-08 16:12:00 +00:00
luukvbaal
4260f73e13 fix(messages): unwanted newlines with ext_messages #37733
Problem:  Newlines intended to write messages below the cmdline or to
          mark the start of a new message on message grid are emitted
          through ext_messages. This results in unnecessary newlines for
          a UI that has decoupled its message area from the cmdline.
          msg_col is set directly in some places which is not transmitted
          to msg_show events.
          Various missing message kind for list commands.
          Trailing newlines on various list commands.

Solution: Only emit such newlines without ext_messages enabled.
          Use msg_advance() instead of setting msg_col directly.
          Assign them the "list_cmd" kind.
          Ensure no trailing newline is printed.
2026-02-08 09:47:02 -05:00
Evgeni Chasnovski
0f73873d4f fix(pack): close confirmation buffer, not tabpage #37756 2026-02-08 09:15:16 -05:00
Mike J McGuirk
6cb3254c2f docs(eval): fix fn.strchar types #37737
Problem: The following strchar functions have incorrect types:

strcharlen() - Currently any. Always returns an integer, including on
error

strcharpart() - The skipcc annotation does not specify that 0 and 1 are
valid. These inputs are required for vimscript usage. The current
return type is any, even though the function returns an empty string
on error

strchars() - The skipcc annotation does not specify that 0 and 1 are
valid

Solution: Update the problem types.
2026-02-08 08:07:49 -05:00
Mike J McGuirk
6771b10b88 docs(eval): correct types for getcharsearch, setcharsearch #37734
Problem: In eval.lua, setcharsearch() has an incorrect param type,
causing Lua_Ls to display an error when a valid table is passed.

While getcharsearch correctly states that it returns a table, the type
is non-specific about the contents.

Solution: Update eval.lua with the correct types.
2026-02-08 08:06:55 -05:00
github-actions[bot]
74fc085078 docs: update version.c #37595
vim-patch:9.1.2111: Vim9: no error for elseif/else after else
vim-patch:9.1.2117: unnecessary braces in terminal.c
vim-patch:602e6042a runtime(doc): Reformat example at :h gui-w32-fullscreen
vim-patch:9.1.2125: MS-Windows: DirectX rendering can be improved
vim-patch:9.1.2127: MS-Windows: DirectX renders font too small
vim-patch:1cac0a575 translation(sv): Remove duplicates from [g]vim.desktop.in
vim-patch:91ec2c3ba CI: update FreeBSD runner to 15.0
2026-02-08 07:35:40 -05:00
Sean Dewar
c90593ed5f test(terminal): skip flaky test on Windows (#37774)
Ref: https://github.com/neovim/neovim/pull/37758#discussion_r2778065203
nightly
2026-02-08 02:27:30 +00:00
zeertzjq
a9454f8511 test(api/server_requests_spec): fix flaky test (#37771)
Sometimes the scheduled :qall can arrive too late, so that EOF isn't
received in the same uv_run() call as the response.
2026-02-08 00:49:13 +00:00
zeertzjq
66b2e7da8a Merge pull request #37770 from zeertzjq/vim-1ff2239
vim-patch: runtime file updates
2026-02-08 08:26:55 +08:00
zeertzjq
deac3fc13f vim-patch:27630b2: runtime(python3complete): remove trailing white space
related: vim/vim#19354

27630b28ad

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2026-02-08 07:07:50 +08:00
zeertzjq
289eb2edd9 vim-patch:d15c718: runtime(compiler): fix space escape in pyright
closes: vim/vim#19354

d15c718038

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2026-02-08 07:07:15 +08:00
zeertzjq
a24f190531 vim-patch:1ff2239: runtime(compiler): add pyright Python type checker
closes: vim/vim#19017

1ff2239053

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2026-02-08 07:06:59 +08:00
zeertzjq
ed8fbd2e29 vim-patch:9.1.2138: win_execute() and 'autochdir' can corrupt buffer name (#37767)
Problem:  With 'autochdir' win_execute() can corrupt the buffer name,
          causing :write to use wrong path.
Solution: Save and restore b_fname when 'autochdir' is active
          (Ingo Karkat).

This is caused by a bad interaction of the 'autochdir' behavior,
overriding of the current directory via :lchdir, and the temporary
window switching done by win_execute(), manifesting when e.g. a custom
completion inspects other buffers:
1. In the initial state after the :lcd .. we have curbuf->b_fname =
   "Xsubdir/file".
2. do_autochdir() is invoked, temporarily undoing the :lcd .., changing
   back into the Xsubdir/ subdirectory.
3. win_execute() switches windows, triggering win_enter_ext() →
   win_fix_current_dir() → shorten_fnames(TRUE)
4. shorten_fnames() processes *all* buffers
5. shorten_buf_fname() makes the filename relative to the current
   (wrong) directory; b_fname becomes "file" instead of "Xsubdir/file"
6. Directory restoration correctly restores working directory via
   mch_chdir() (skipping a second do_autochdir() invocation because
   apply_acd is FALSE), but b_fname remains corrupted, with the
   "Xsubdir/" part missing.
7. expand("%:p") (and commands like :write) continue to use the
   corrupted filename, resolving to a wrong path that's missing the
   "Xsubdir/" part.

To fix the problem the short filename is saved if its in effect (i.e.
pointed to by curbuf->b_fname) and 'autochdir' happened. It's then
restored in case of a local cwd override. The conditions limit this
workaround to when 'autochdir' is active *and* overridden by a :lchdir.

closes: vim/vim#19343

abb4d74033

Co-authored-by: Ingo Karkat <swdev@ingo-karkat.de>
2026-02-08 07:04:36 +08:00
zeertzjq
72eb9fe87c vim-patch:partial:9.1.2137: test: Update tests for OpenBSD (#37766)
Problem:  Some tests are not valid on OpenBSD.
Solution: Add CheckNotOpenBSD, use it to skip certain tests
          (Kevin Goodsell).

Test_readdirex_sort performs locale-dependent sorting. OpenBSD has
minimal locale support.

Test_stdin_no_newline hangs on OpenBSD and FreeBSD. I don't know exactly
why, but it may be due to bash not exiting at the end of the test. This
is skipped in the FreeBSD CI runs because bash is not installed.

Test_detect_fifo uses /dev/fd/ files (via process substitution) as
FIFOs. On OpenBSD the files in /dev/fd are not FIFOs.

closes: vim/vim#19351

a24cb278bd

Co-authored-by: Kevin Goodsell <kevin-opensource@omegacrash.net>
2026-02-08 07:03:41 +08:00
zeertzjq
e704529909 vim-patch:9.1.2136: :tab sbuffer may close old tabpage (#37765)
Problem:  :tab sbuffer may close old tabpage if BufLeave autocommand
          splits window (after 9.1.0143).
Solution: Only close other windows if the buffer will be unloaded
          (zeertzjq).

related: neovim/neovim#37749
closes: vim/vim#19352

6da9f757c4
2026-02-07 23:03:21 +08:00
zeertzjq
1196bf8f40 vim-patch:7ccb81b: runtime(tar): Make the path traversal detection more robust (#37764)
closes: vim/vim#19341

7ccb81bdb6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-07 23:03:07 +08:00
Justin M. Keyes
7720e52a0b Merge #37424 $XDG_CONFIG_DIRS with init.lua, $NVIM_APPNAME 2026-02-06 13:28:43 -05:00
horrifyingHorse
ba6440c106 fix(terminal): reset w_leftcol after resizing terminal
Problem: windows may scroll horizontally upon resize using the old terminal
size, which may be unnecessary and cause the content to be partially out-of-view.

Solution: reset the horizontal scroll after resizing.
2026-02-06 15:50:05 +00:00
Jesse van der Pluijm
5c51b45a82 fix(startup): respect $NVIM_APPNAME in $XDG_CONFIG_DIRS paths
Problem:

$NVIM_APPNAME was not respected when searching $XDG_CONFIG_DIRS for
config files. Nvim hardcoded "nvim" when constructing paths like
`$XDG_CONFIG_DIRS/nvim/init.lua`, ignoring the $NVIM_APPNAME environment
variable.

This meant that config files like `$XDG_CONFIG_DIRS/myapp/init.lua` were
not loaded, even though $NVIM_APPNAME was set to "myapp".

Solution:

Use `get_appname()` instead of hardcoded "nvim" for $XDG_CONFIG_DIRS
paths in `do_system_initialization()` and `do_user_initialization()`.
This makes $XDG_CONFIG_DIRS behave consistently with $XDG_CONFIG_HOME,
which already respected $NVIM_APPNAME.

As documented in `runtime/doc/starting.txt` (L1440-L1441):
"In the help wherever `$XDG_CONFIG_…/nvim` is mentioned it is understood
as `$XDG_CONFIG_…/$NVIM_APPNAME`."

See:
43339dee40/runtime/doc/starting.txt (L1440-L1441)

Relates to #37405
2026-02-06 16:12:01 +01:00
Jesse van der Pluijm
f899045adc refactor(startup): extract conflicting configs error to errors.h
Problem:
The E5422 error message was duplicated in two places in main.c, and
hardcoded error strings should be centralized in errors.h for consistency.

Solution:
Add e_conflicting_configs to errors.h and replace both inline error
strings with the centralized constant.
2026-02-06 16:11:22 +01:00
Jesse van der Pluijm
c785d5cdf0 fix(startup): source init.lua from XDG_CONFIG_DIRS
Problem:

`init.lua` files in `$XDG_CONFIG_DIRS` directories were not being sourced during startup, even though the documentation states they should be searched alongside `init.vim`.

See:

e51f5e17e1/runtime/doc/starting.txt (L495-L496)

Solution:

Modify `do_user_initialization()` to search for `init.lua` in each `$XDG_CONFIG_DIRS` directory before falling back to `init.vim`, matching the behavior for `$XDG_CONFIG_HOME`. Also show `E5422` error if both `init.lua` and `init.vim` exist in the same directory.

Fixes #37405
2026-02-06 16:11:22 +01:00
luukvbaal
a33e5fb1bb fix(ui): cmdline_block events for exmode #37751
Problem:  Exmode is missing cmdline_block events.
Solution: Emit cmdline_block_show/append when executing a cmdline during
          exmode. Emit cmdline_block_hide when leaving exmode.
2026-02-06 08:10:33 -05:00
zeertzjq
d2141396cd vim-patch:422ef98: runtime(doc): fix pattern problem in cmdline.txt (#37753)
closes: vim/vim#19322

422ef984b5

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2026-02-06 12:55:07 +00:00
Mathias Fußenegger
c4f322b769 refactor(lsp): always fetch lenses again in codelens.run (#37720)
The auto-refresh has a bit of a delay so it can happen that when a user
runs `codelens.run` it operates on an outdated state and either
does nothing, or fails.

This changes the logic for `.run` to always fetch the current lenses
before (optional) prompt and execution.

See discussion in https://github.com/neovim/neovim/pull/37689#discussion_r2764235931

This could potentially be optimized to first check if there's local
state with a version that matches the current buf-version, but in my
testing re-fetching them always was quickly enough that `run` still
feels instant and doing it this way simplifies the logic.

Side effect of the change is that `.run` also works if codelens aren't
enabled - for power users who know what the codelens would show that can
be useful.
2026-02-06 13:31:44 +01:00
zeertzjq
6dd0a7d60a vim-patch:9.1.2135: tests: tar plugin does not consider 'nowrapscan' (#37752)
Problem:  search() is used to check for the message from tar that
          indicates leading slashes found in the tar archive, or to
          check for the leading slashes themselves. However, if
          'nowrapscan' is in effect these searches are limited to the
          last line and don't find any results. This causes the warning
          message from tar to be seen in the buffer, the "Path Traversal
          Attack Detected" message to be omitted, and editing actions
          can fail. This can be seen, for example, when editing
          src/testdir/samples/evil.tar.
Solution: Use the 'w' flag for search() (Kevin Goodsell)

closes: vim/vim#19333

18d844e365

Co-authored-by: Kevin Goodsell <kevin-opensource@omegacrash.net>
2026-02-06 20:25:14 +08:00
zeertzjq
d3bfde60ad vim-patch:56d470a: runtime(lf): update syntax to support lf version r41 (#37750)
Also, mark @CatsDeservePets as maintainer.

closes: vim/vim#18640

56d470a008

Co-authored-by: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com>
2026-02-06 12:17:19 +00:00
zeertzjq
15061d322d vim-patch:9.1.2133: Another case of buffer overflow with 'helpfile' (#37746)
Problem:  Another case of buffer overflow with 'helpfile'.
Solution: Leave room for "tags" in the buffer (zeertzjq).

closes: vim/vim#19340

21d591fb12
2026-02-06 18:29:24 +08:00
zeertzjq
db133879b2 vim-patch:9.1.2132: [security]: buffer-overflow in 'helpfile' option handling (#37735)
Problem:  [security]: buffer-overflow in 'helpfile' option handling by
          using strcpy without bound checks (Rahul Hoysala)
Solution: Limit strncpy to the length of the buffer (MAXPATHL)

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-5w93-4g67-mm43

0714b15940

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-06 07:40:51 +08:00
zeertzjq
e40c5cb06d fix(vterm): handle split UTF-8 after ASCII properly (#37721)
Problem:  libvterm doesn't handle split UTF-8 sequence after ASCII.
Solution: Only use one UTF-8 encoding state per vterm state.
2026-02-06 07:28:26 +08:00
luukvbaal
e198037148 fix(ui2): always route to dialog when cmdline is open #37730
Problem:  Messages emitted while cmdline is open are not shown with
          cmdline message target.
Solution: Route to dialog window when cmdline is open.
2026-02-05 14:54:22 -05:00
luukvbaal
7a490d65c5 fix(messages): increment message ID without ext_messages #37714
Problem:  Message ID is not incremented without ext_messages.
Solution: Increment where callstack reaches without ext_messages.
          There is no clear place marking the end of internal
          messages without ext_messages so IDs are only incremented
          with `nvim_echo` calls. Message IDs are currently not exposed
          anywhere but the msg_show event for this to matter.
2026-02-05 09:55:11 -05:00
Christian Clason
13a9cdc6b4 docs(lua): vim.keymap.set takes no noremap #37723
Problem: Unlike `nvim_keymap_set`, `vim.keymap.set` uses the non-negated
`remap` instead of `:set`'s `noremap`, but the documentation for this
got lost sometime before Nvim 0.10.

Solution: Restore the lost documentation and make it more explicit.
2026-02-05 08:43:04 -05:00
zeertzjq
6f27eb1591 ci(cirrus): update to FreeBSD 15.0 (#37716) 2026-02-05 21:39:08 +08:00
luukvbaal
f1dcde6cba fix(messages): single msg_show event for :global command #37728
Problem:  "first" parameter added in 912388f5 for grouping printed lines
          in a single event is ineffective for the :global command.
Solution: Only set the message kind for the first printed line during a
          :global command.
2026-02-05 08:37:20 -05:00
luukvbaal
bf68ba40a0 refactor: rename _extui => _core.ui2 #37692
Problem:
_extui module name is confusing and should eventually end up in _core/.

Solution:
Move it there and name it ui2.
2026-02-05 07:45:45 -05:00
zeertzjq
b95e0a8d20 test(terminal/cursor_spec): fix flaky test (#37715)
Problem:  Cursor visibility test may fail if the :sleep lasts too long.
Solution: Wait for the TermLeave autocommand to finish.
2026-02-05 14:27:15 +08:00
zeertzjq
396edf1e46 vim-patch:61044eb: runtime(haskellcomplete): fix Undefined variable b:completingLangExtension. (#37712)
closes: vim/vim#19259

61044eb536

Co-authored-by: Arkissa <mrarkssac@gmail.com>
2026-02-05 01:32:40 +00:00
zeertzjq
da60b80a74 vim-patch:03b42b2: runtime(doc): add note for -complete=shellcmdline (#37713)
closes: vim/vim#19330

03b42b2926

Co-authored-by: Mao-Yining <101858210+mao-yining@users.noreply.github.com>
2026-02-05 01:26:27 +00:00
luukvbaal
72a557c61b fix(ui2): only copy highlight marks when expanding cmdline #37709
Problem:  Error copying over multi-line message span marks to expanded cmdline.
Solution: Only copy over the highlight marks as intended.
2026-02-04 19:23:22 -05:00
zeertzjq
814f2629cb fix(terminal): handle split composing chars at right edge (#37694)
Problem:
Recombining composing chars in terminal doesn't work at right edge.

Solution:
Check for the case where printing the previous char didn't advance the
cursor. Reset at_phantom when returning to combine_pos.
2026-02-05 00:19:11 +00:00
Justin M. Keyes
a124439559 test(lsp): retry "on_type_formatting enables formatting on type" #37711
FAILED   test/functional/plugin/lsp/on_type_formatting_spec.lua @ 59: vim.lsp.on_type_formatting enables formatting on type
    test/functional\plugin\lsp\on_type_formatting_spec.lua:65: retry() attempts: 1
    test/functional\plugin\lsp\on_type_formatting_spec.lua:66: Expected objects to be the same.
    Passed in:
    (table: 0x01772f47b6d8) {
      [1] = 'int main() {'
     *[2] = '  int hi = 5'
      [3] = '}' }
    Expected:
    (table: 0x017731aad3a8) {
      [1] = 'int main() {'
     *[2] = '  int hi = 5;'
      [3] = '}' }

    stack traceback:
            test\testutil.lua:89: in function 'retry'
            test/functional\plugin\lsp\on_type_formatting_spec.lua:65: in function <test/functional\plugin\lsp\on_type_formatting_spec.lua:59>
2026-02-05 00:03:06 +00:00
zeertzjq
bdd886622d vim-patch:9.1.2130: Page scrolling in Insert mode beeps (#37710)
Problem:  Page scrolling in Insert mode beeps (after 9.1.0211).
Solution: Fix incorrect return value of pagescroll(). Also invert the
          return value of scroll_with_sms() to be less confusing and
          match comments (zeertzjq).

fixes:  vim/vim#19326
closes: vim/vim#19327

a8ce914db1
2026-02-04 23:36:57 +00:00