Commit Graph

10131 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
luukvbaal
8c7bbfba3d fix(ui2): callbacks reference stale message-window handles #37673
Problem:  Scheduled callbacks reference potentially outdated window
          handles e.g. after switching tabpage.
Solution: Use ext.wins which stores the updated window handles.
2026-02-02 10:54:26 -05:00
zeertzjq
0566767d7d vim-patch:2e4c98b: runtime(vim): Update base syntax, match Vim9 :unlet command (#37662)
closes: vim/vim#19290

2e4c98b6f3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 23:22:51 +00:00
zeertzjq
5da2a4b59a vim-patch:079700e: runtime(doc): Improve the description at :help :cwindow (#37661)
Describe the "height" argument when opening the quickfix window.

See: vim/vim#19302 ("[cl]window" has different behaviour from "[cl]open" about
their argument [height])

related: vim/vim#19302
closes:  vim/vim#19305

079700ee45

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 23:05:34 +00:00
zeertzjq
1906da52db fix(lua): close vim.defer_fn() timer if vim.schedule() failed (#37647)
Problem:
Using vim.defer_fn() just before Nvim exit leaks luv handles.

Solution:
Make vim.schedule() return an error message if scheduling failed.
Make vim.defer_fn() close timer if vim.schedule() failed.
2026-02-01 21:29:19 +08:00
Maria Solano
0501c5fd09 fix(lsp): call on_list before reading loclist #37645
Problem:
`on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true.

Solution:
Change the order of the relevant blocks.
2026-02-01 07:18:16 -05:00
zeertzjq
e283a60a69 vim-patch:0195622: runtime(qf): Update quickfix syntax
closes: vim/vim#19296

01956225bc

Co-authored-by: GX <59413576+gx089@users.noreply.github.com>
2026-02-01 08:31:38 +08:00
zeertzjq
c74d5ceda1 vim-patch:dd9f7e6: runtime(doc): Fix some overlength lines
closes: vim/vim#19286

dd9f7e6cbb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 08:30:59 +08:00
zeertzjq
b6237de224 vim-patch:c99aaf4: runtime(colors): improve catppuccin colorscheme
- fix readability issue with IncSearch/CurSearch
- add highlights to some of ftplugins distributed with vim

closes: vim/vim#19295

c99aaf4c87

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-02-01 08:22:07 +08:00
Harsh Kapse
36db6ff2c1 fix(lsp): use LSP textEdit range for completion start boundary (#37491)
Previously, adjust_start_col returned nil when completion items had
different start position from lsp textEdit range
This caused the completion to fall back to \k*$ which ignores the
non-keyword characters

Changes:
- adjust_start_col: now returns the minimum start postion among all
items instead of nil
- _lsp_to_complete_items - normalizes the items by adding the gap between
  current and minimum start

Fixes: https://github.com/neovim/neovim/issues/37441
2026-01-30 15:34:42 +01:00
zeertzjq
a60d5f863e vim-patch:b817536: runtime(tera): update syntax files to support many more tera code (#37622)
This includes macros, keys etc. which were not highlighted before.

closes: vim/vim#19276

b817536b8f

Co-authored-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
2026-01-30 00:08:49 +00:00
Evgeni Chasnovski
1aa81290a4 docs(pack): clarify caveats about installing based on the lockfile 2026-01-29 16:24:33 +02:00
zeertzjq
484f455402 test(terminal): status is -1 in TermClose if buffer is deleted (#37609) 2026-01-29 08:29:49 +00:00
zeertzjq
4e52a2d386 vim-patch:97d1255: runtime(colors): Update colorscheme and add TitleBar/TitleBarNC
closes: vim/vim#18513

97d1255558

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:27:42 +08:00
zeertzjq
d1b8b3b450 vim-patch:b1b8050: runtime(colors): update colorschemes:
- Add PreInsert (darkblue, habamax, lunaperche, wildcharm, retrobox).
- Update QuickFixLine (habamax, lunaperche, wildcharm, retrobox) - make
  it foreground transparent in GUI.
- Make Todo in wildcharm just bold.

closes: vim/vim#18304

b1b80506ce

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:24:29 +08:00
zeertzjq
17555de267 vim-patch:f3055ea: runtime(colors): Update colorschemes
- all colorschemes were ported to colortemplate v3
- gui versions of habamax, lunaperche, wildcharm, retrobox colorschemes
  have different Diff, Visual, Search and IncSearch colors compared to non-gui.
- habamax Search was changed to green instead of blue to better distinct
  it with Visual (also bluish in gui)

closes: vim/vim#18061

f3055eac84

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:23:01 +08:00
zeertzjq
3739376af7 vim-patch:663d809: runtime(rust): Fix Rust indentation when string contains "if"
indent/rust.vim behaves incorrectly when a string literal contains the
substring "if".

For example, in this code:

    let x = "
                motif
    ";
    struct X {
                }

indent/rust.vim thinks that the closing "}" should line up with "motif".

This patch fixes the issue by checking whether the "if" is in a string
literal or comment before considering it to be a match for a subsequent
brace (and also by requiring it to start on a word boundary).

Add an indent test to ensure this does not regress.

closes: vim/vim#19265

663d809194

Co-authored-by: taylor.fish <contact@taylor.fish>
2026-01-29 08:23:15 +08:00
zeertzjq
bfb30f7599 vim-patch:427fa3e: runtime(doc): 'ignorecase' affects character classes in the old engine
fixes: vim/vim#19230

427fa3e1e4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-29 08:22:51 +08:00
zeertzjq
80788dc9db vim-patch:b73565d: runtime(make): Declare syntax file orphaned
closes: vim/vim#19267

b73565d89d

Co-authored-by: Roland Hieber <rohieb@rohieb.name>
2026-01-29 08:22:15 +08:00
zeertzjq
78961f0bb4 vim-patch:c979211: runtime(8th): Update syntax script
closes: vim/vim#19261

c979211675

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2026-01-29 08:21:45 +08:00
Phạm Bình An
c7c5455da1 vim-patch:1e54023: runtime(doc): clarify vim.eval behavior with Vim special variables (#37369)
Problem:  The behavior of vim.eval() with Vim special variables is not
          clearly documented. It is (partly) the reason why Nvim
          Python's vim.eval gives different output when evaluating
          v:true and v:false
Solution: Document it (Phạm Bình An)

closes: vim/vim#19157

1e54023673
2026-01-29 07:19:20 +08:00
phanium
babdab2f70 perf(filetype): vim.filetype.get_option cache miss when option value is false #37593
Problem: when option value is false, it's treated as invalid
then trigger FileType event again

Solution: use cached false value
2026-01-28 05:58:00 -05:00
Yochem van Rosmalen
f7041625f1 refactor(lua): use vim.fs instead of fnamemodify
Although powerful -- especially with chained modifiers --, the
readability (and therefore maintainability) of `fnamemodify()` and its
modifiers is often worse than a function name, giving less context and
having to rely on `:h filename-modifiers`. However, it is used plenty in
the Lua stdlib:

- 16x for the basename: `fnamemodify(path, ':t')`
- 7x for the parents: `fnamemodify(path, ':h')`
- 7x for the stem (filename w/o extension): `fnamemodify(path, ':r')`
- 6x for the absolute path: `fnamemodify(path, ':p')`
- 2x for the suffix: `fnamemodify(path, ':e')`
- 2x relative to the home directory: `fnamemodify(path, ':~')`
- 1x relative to the cwd: `fnamemodify(path, ':.')`

The `fs` module in the stdlib provides a cleaner interface for most of
these path operations: `vim.fs.basename` instead of `':t'`,
`vim.fs.dirname` instead of `':h'`, `vim.fs.abspath` instead of `':p'`.
This commit refactors the runtime to use these instead of fnamemodify.

Not all fnamemodify calls are removed; some have intrinsic differences
in behavior with the `vim.fs` replacement or do not yet have a
replacement in the Lua module, i.e. `:~`, `:.`, `:e` and `:r`.
2026-01-28 10:57:39 +00:00
Josh Cooper
9988d7142d fix(types): add missing @return annotations 2026-01-28 10:56:36 +00:00
Phạm Bình An
3e6db5b2ec fix(termdebug): use mark : to get prompt line in prompt buffer #37336
Problem:
- Nvim supports multi-line input in prompt buffer, so line(`$`) is not
  always the prompt line.

Solution:
- Use `line("':")` to get the prompt line.
2026-01-27 18:19:38 -05:00
phanium
fd45bc8cab fix: lsp.enable() don't work correctly inside FileType event #37538
Problem:
Two cases lsp.enable() won't work in the first FileType event
1. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim a.lua
```

2. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim -> :edit a.lua -> :mksession! | restart +qa! so Session.vim
```

Solution:
Currently `v:vim_did_enter` is used to detected two cases:
1. "maunally enabled" (lsp.enable() or `:lsp enable`)
2. "inside FileType event"

To detect 2. correctly we use did_filetype().
2026-01-27 17:59:36 -05:00
zeertzjq
6a28835320 vim-patch:0f3b7d2: runtime(doc): fix missing code block marker in ft-python-syntax (#37588)
related: vim/vim#18922
closes:  vim/vim#19261

0f3b7d2563
2026-01-28 06:50:24 +08:00
Phạm Bình An
d96a88252e docs: misc #37357
Problem:
- According to [pipx
  documentation](https://pipx.pypa.io/stable/docs/#pipx-install), `pipx
  install` doesn't have --upgrade argument. Running `pipx install
  --upgrade pynvim` results in an error "unrecognized arguments:
  --upgrade"
- In file if_pyth.txt:317, it says "Implementation is ... written in C".
  This is not true for Nvim, since find_module logic of Nvim's Python
  interface is implemented in Python.
  (fdaae821a9/pynvim/plugin/script_host.py (L217))
- $NVIM_LISTEN_ADDRESS has been deprecated.
- `:Next` is a core command, not termdebug plugin command. Termdebug
  uses `:Over` to send command `next` to gdb

Solution:
- Just use `pipx install pynvim`
2026-01-27 17:14:57 -05:00
Olivia Kinnear
34815777b2 fix(lsp): remove side-effects if vim.lsp.enable() raises an error (#37571)
Problem:
If `vim.lsp.enable()` fails with an error, either because `'*'` is one
of the provided names or because there is an error in a config,
`vim.lsp.enable()` will still have side-effects:
- All names before the one that encountered an error will still be added
  to `lsp._enabled_configs`, but the autocommand will not get added or
  run.
- Any name which makes `vim.lsp.config[name]` error will be added to
  `lsp._enabled_configs`, causing all future calls to `vim.lsp.enable()`
  to fail. This will also break `:che vim.lsp`.

Solution:
- Check all names for errors before modifying `lsp._enabled_configs`.
- Check `vim.lsp.config[name]` does not raise an error before enabling
  the name.
2026-01-27 13:17:45 -08:00
Justin M. Keyes
c2ecc9ca41 Merge #37309 :checkhealth vim.pack 2026-01-27 09:19:46 -05:00
phanium
dfa5d79d05 fix: misc typos #37471 2026-01-27 09:18:02 -05:00
glepnir
ae93639ec4 fix(health): use FileType autocmd for bug report winbar #37486
Problem: In float mode, vim.schedule() may run before filetype is set,
so winbar is not shown.

Solution: Use FileType autocmd to ensure winbar is set after filetype.
Also use type=Bug in URL.
2026-01-27 09:06:50 -05:00
jdrouhard
8ed68fda50 feat(lsp): semantic token range improvements #37451
* cache all tokens from various range requests for a given document
  version
  - all new token highlights are merged with previous highlights to
    maintain order and the "marked" property
  - this allows the tokens to stop flickering once they've loaded once
    per document version
* abandon the processing coroutine if the request_id has changed instead
  of relying only on the document version
  - this will improve efficiency if a new range request is made while a
    previous one was processing its result
* apply new highlights from processing coroutine directly to the current
  result when the version hasn't changed
  - this allows new highlights to be immediately drawable once they've
    processed instead of waiting for the whole response to be processed
    at once
* rpc layer was changed to provide the request ID back in success
  callbacks, which is then provided as a request_id field on the handler
  context to lsp handlers
2026-01-27 08:56:52 -05:00
skewb1k
8c63d84be1 feat(health): check vim.ui.open() tool #37569
Problem:
`:checkhealth` does not report when no `vim.ui.open()` handler is
available.

Solution:
Factor command resolution into `_get_open_cmd()` and reuse it from
`:checkhealth` to detect missing handlers.
2026-01-27 08:51:00 -05:00
zeertzjq
d4360596b5 vim-patch:b424349: runtime(colors): include new catppuccin colorscheme (#37570)
closes: vim/vim#19258

b42434915b

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-27 19:51:10 +08:00
Olivia Kinnear
c28113dd9d fix(health): add back vim.cmd.redraw() call (#37576)
Was erroneously removed by #37462 during rebase.
2026-01-27 08:54:27 +01:00
zeertzjq
f79bddd669 vim-patch:b8efcc0: runtime(vim): set 'path' to common Vim directories
closes: vim/vim#19219

b8efcc0202

Co-authored-by: Mateo Gjika <104777599+mateoxh@users.noreply.github.com>
2026-01-27 07:20:41 +08:00
zeertzjq
6543217afc vim-patch:632fd8b: runtime(python): Highlight built-in constants in Python
Also add syntax tests for those newly constants.

closes: vim/vim#17788
closes: vim/vim#18922

632fd8bb96

Co-authored-by: Rob B <github@0x7e.net>
2026-01-27 07:20:41 +08:00