Commit Graph

35269 Commits

Author SHA1 Message Date
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
Sean Dewar
506dd7252a fix(ui): remember cursor shape when obscured #37704
Problem:
a2b92a5efb is regressive if the
ui_mode_idx set by ui_cursor_shape differs from what ui_flush later sets
it to. (e.g: if mode changes between both calls)

Solution:
Don't overwrite ui_mode_idx to obscure the cursor so that we don't
forget what shape was last set by ui_cursor_shape.

May not be needed, but does fix a potential regression. (and makes it
easier to set ui_mode_idx to something other than cursor_get_mode_idx's
retval in other places, if that's ever wanted)
2026-02-04 17:43:21 -05:00
zeertzjq
70b1b15144 test(tui_spec): check that 'ttimeoutlen' works (#37702) 2026-02-05 06:26:59 +08:00
luukvbaal
db2a54996e feat(ui2): replace message by its ID #37672
Problem:  UI2 does not implement the msg_show event msg_id parameter.
Solution: Store message IDs currently shown in the cmd/msg buffers.
          Set extmarks spanning the message which are used to replace
          a still visible message when a new message with the same ID
          is received.
2026-02-04 14:11:35 -05:00
Sean Dewar
da7580498a test(float): cursor unobscured by hidden float and in cmdline 2026-02-04 18:55:21 +00:00
Kevin Locke
2a906bfad6 docs: setting g:clipboard after provider init #37705
Problem:
Users may be unaware that setting `g:clipboard` after providers are
initialized has no effect, and that `has('clipboard')` initializes
providers, as in #13062.

Solution:
Note the restriction and link to workarounds in FAQ for discoverability.
2026-02-04 13:53:08 -05:00
glepnir
a2b92a5efb feat(ui): show "empty" cursor behind unfocused floatwin #37624
Problem:
There is no indication of when cursor is "behind" an unfocused, floating window.

Solution:
Set underline cursor to indicate when an unfocused floatwin is over the active cursor.
2026-02-04 10:09:50 -05:00
zeertzjq
379e307148 fix(terminal): also don't propagate $COLORTERM on Windows (#37699)
The same reason in #26440 applies to Windows as well.
2026-02-04 23:07:47 +08:00
Sean Dewar
9655bd560f fix(ui2): don't adjust dialog pos for pum wildmenu (#37695)
Problem:  Dialog position unnecessarily adjusted for pum wildmenu.
Solution: Apply no offset if the pum is visible.
2026-02-04 13:15:34 +01:00
zeertzjq
ddd1bf757f Merge pull request #37693 from zeertzjq/vim-c65643c
vim-patch: Vim ftplugin updates
2026-02-04 07:57:28 +08:00
zeertzjq
8f1667445e vim-patch:ac5af8e: runtime(vim): Fix for :VimKeywordPrg when syntax does not match
When using vim9-syntax plugin, :VimKeywordPrg does not lookup functions
correctly, as it relies solely on syntax names to find the help topic.

The syntax keyword used for builtin function is vi9FuncNameBuiltin in
vim9-syntax plugin, not vimFuncName expected by :VimKeywordPrg, so the
fallback rules apply, and there is no fallback rule for function calls.

Fix by just checking if the first char after topic is '(', and if so
assume help topic is a function.

closes: vim/vim#19320

ac5af8ecd3

Co-authored-by: Mark Woods <mwoods.online.ie@gmail.com>
2026-02-04 07:14:12 +08:00
zeertzjq
f3e2e718ec vim-patch:c65643c: runtime(vim): Update ftplugin, fix option variable 'keywordprg' matching
- Match &option, and &[lg]:option variables.
- Match Ex commands after :bar.
- Fix matching of pre and post context text.
- Style - use '..' for string concatenation.

fixes vim/vim#17567
closes: vim/vim#17653

c65643cbec

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-04 07:13:06 +08:00
Tomasz N
90abd2613d fix(lsp): don't empty server start-boundary by next client response #37665
Problem:
Server start boundary can be emptied by response provided by next client.

Solution:
Don't empty it when extending the result list.
2026-02-03 15:30:05 -05:00
Rawan Muhammad
0ddba68607 build: ensure toolchain is passed to bundled deps #37587
Problem:
When building Neovim with Emscripten for WebAssembly, the
`CMAKE_TOOLCHAIN_FILE` is not propagated to dependency builds.
So libuv attempts to include Linux-specific headers like
`sys/epoll.h` which don't exist in the WebAssembly environment.

From #37572:

    …/NeovimWeb/external/neovim/.deps/build/src/libuv/src/unix/linux.c:44:10:
    fatal error: 'sys/epoll.h' file not found
       44 | #include <sys/epoll.h> |          ^~~~~~~~~~~~~

Solution:
1. Add initialization for DEPS_CMAKE_ARGS to prevent CMake errors.
2. Implement conditional logic to always pass CMAKE_TOOLCHAIN_FILE to
   dependencies.

This allows dependencies like libuv to detect they're building for
WebAssembly and disable incompatible Linux specific features such as
epoll which resolves the sys/epoll.h error.
2026-02-03 13:26:55 -05:00
jdrouhard
9278f792c3 feat(lsp): support range + full semantic token requests #37611
From the LSP Spec:
> There are two uses cases where it can be beneficial to only compute
> semantic tokens for a visible range:
>
> - for faster rendering of the tokens in the user interface when a user
>   opens a file. In this use case, servers should also implement the
>   textDocument/semanticTokens/full request as well to allow for flicker
>   free scrolling and semantic coloring of a minimap.
> - if computing semantic tokens for a full document is too expensive,
>   servers can only provide a range call. In this case, the client might
>   not render a minimap correctly or might even decide to not show any
>   semantic tokens at all.

This commit unifies the usage of range and full/delta requests as
recommended by the LSP spec and aligns neovim with the way other LSP
clients use these request types for semantic tokens.

When a server supports range requests, neovim will simultaneously send a
range request and a full/delta request when first opening a file, and
will continue to issue range requests until a full response is
processed. At that point, range requests cease and full (or delta)
requests are used going forward. The range request should allow servers
to return a result faster for quicker highlighting of the file while it
works on the potentially more expensive full result. If a server decides
the full result is too expensive, it can just error out that request,
and neovim will continue to use range requests.

This commit also fixes and cleans up some other things:

- gen_lsp: registrationMethod or registrationOptions imply dynamic
  registration support
- move autocmd creation/deletion to on_attach/on_detach
- debounce requests due to server refresh notifications
- fix off by one issue in tokens_to_ranges() iteration
2026-02-03 13:16:12 -05:00
Sean Dewar
fede568692 vim-patch:9.1.2128: Heap use after free in buf_check_timestamp()
Problem:  heap UAF if autocommands from reloading a file changed outside
          of Vim wipe its buffer.
Solution: Validate the bufref after buf_reload (Sean Dewar)

closes: vim/vim#19317

392b428d12

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-02-03 17:38:57 +00:00
Justin M. Keyes
f5931102f8 Merge #37626 feat(lsp)!: textDocument/codeLens as decoration provider 2026-02-03 09:46:37 -05:00
Yi Ming
6f733f4a9b fix(lsp): avoid scheduling client deletion before LspNotify #37685
Problem:
`Client.on_exit` runs `Client._on_detach` and the client removal logic
within two separate `vim.schedule` sequentially. However, since
`Client._on_detach` executes `LspNotify` inside `vim.schedule`, this
causes `LspNotify` to be executed after the client removal, which is
scheduled first. At that point, a valid `Client` can no longer be
retrieved within the autocmd callback.

Solution:
Put the client deletion inside the `vim.schedule` call.
2026-02-03 09:33:14 -05:00
Yi Ming
965468fca1 feat(lsp): support workspace/codeLens/refresh 2026-02-03 22:25:21 +08:00
Yi Ming
fe23168e2b feat(lsp)!: reimplement textDocument/codeLens as decoration provider 2026-02-03 22:25:18 +08:00
zeertzjq
16680e57ba fix(tui): use 0x7f as Backspace on Windows with VT input (#37679)
Problem:  0x08 is treated as Backspace instead of Ctrl-H on Windows.
Solution: Treat 0x7f as Backspace if VT input is enabled, so that 0x08
          is treated as Ctrl-H.

Ref: https://github.com/microsoft/terminal/issues/4949
2026-02-03 21:40:40 +08:00
Pavel Pisetski
41cac54325 feat(defaults): exclude temp dirs from 'shada' oldfiles #37631
Problem:
Temporary files from /tmp/ and /private/ paths clutter :oldfiles list.
Additionally, the documented Windows default (rA:,rB:) was never applied
due to a missing platform condition.

Solution:
Drop platform-specific shada differences and default to excluding
/tmp/ and /private/ paths.
2026-02-03 08:31:37 -05:00
Anatolii Sakhnik
11e82c108d fix(l10n): update Ukrainian translations #37654
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2026-02-03 08:24:55 -05:00
luukvbaal
3038f0191e fix(ui2): wildmenu hidden behind dialog window #37684
Problem:  The wildmenu is hidden behind the dialog window with "list" in 'wildmode'.
          Global ('laststatus' set to 3) statusline is hidden behind the
          pager window.
Solution: Check wildmenumode() to adjust the dialog position when necessary.
          Ensure pager is positioned above the global statusline with 'laststus' set to 3.
2026-02-03 08:17:33 -05:00
Shadman
dbb3986f33 fix(prompt): ensure prompt-mark col gets reseted properly #37669
problem: currently when empty string is set as prompt the prompt-mark
column doesn't update.

solution: ensure the column is reset to 0 when starting prompt buffer and
before creating a new prompt after prompt-callback.
2026-02-03 08:01:05 -05:00
luukvbaal
c85313bac7 fix(messages): always assign msg_id to msg_show events #37671
Problem:  Internal messages do not have an ID, which is unexpected and
          undocumented.
Solution: Always assign a msg_id to msg_show events, simplifying
          logic/expectations for UIs.
2026-02-03 07:52:03 -05:00
zeertzjq
d594407735 test: unskip msgpackparse() test on Windows (#37683)
Not sure when it was fixed, but it passes now.
2026-02-03 16:31:27 +08:00
zeertzjq
963162b338 test(terminal/cursor_spec): fix flaky test (#37681) 2026-02-03 05:08:34 +00:00
zeertzjq
4c0d1aceec vim-patch:093d0cb: runtime(doc): Clarify the behaviour of command completion functions (#37680)
closes: vim/vim#19294

093d0cb1cf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-03 03:16:17 +00:00
zeertzjq
af4115ce2b test(tty-test): enable VTI and VTP on Windows (#37677) 2026-02-03 08:50:27 +08:00