36664 Commits

Author SHA1 Message Date
zeertzjq
c8dbb04da9 vim-patch:9.2.0510: setline() mapping may trigger autoindent (#39961)
Problem:  setline() insert mode mapping may trigger autoindent,
          corrupting the newly inserted line content (Evgeni Chasnovski)
Solution: Only strip autoindent whitespace when the rest of the line is
          all whitespace (glepnir).

fixes:  vim/vim#19363
closes: vim/vim#20290

e3dedac77b

Co-authored-by: glepnir <glephunter@gmail.com>
nightly
2026-05-23 08:57:36 +08:00
zeertzjq
7a1bad27ca vim-patch:9.2.0513: [security]: memory safety issues in spellfile.c (#39960)
Problem:  [security]: memory safety issues in spellfile.c
          (tacdm)
Solution: Add recursion limit to read_tree_node(), add length limit
          check in tree_count_words(), use alloc_clear() in
          spell_read_tree().

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-3h95-3962-mmvf

25e4e46c58

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 00:51:47 +00:00
zeertzjq
f53d9ac90b vim-patch:c7645fc: runtime(doc): add a few references to mouse behaviour (#39959)
fixes: vim/vim#20281

c7645fcda5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-23 07:47:49 +08:00
Luuk van Baal
b58ce1ab79 fix(statusline): no cmdline ruler for autocommand window
Problem:  Cmdline ruler may be drawn for autocommand window.
Solution: Check that the current window is not an autocommand window
          when deciding whether to draw the ruler.
2026-05-22 17:54:24 +02:00
dependabot[bot]
17f233d56b ci: bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `github/codeql-action` from 4.35.4 to 4.35.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.35.4...v4.35.5)

Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.5
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](b1d7e1fb5d...a16621b09c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-22 15:04:11 +02:00
Justin M. Keyes
a9deb8be53 Merge #39000 MessageStream abstraction 2026-05-22 08:45:10 -04:00
Yi Ming
680ab13951 refactor(lsp): avoid using coroutine when parsing frames 2026-05-22 18:20:55 +08:00
Yi Ming
0e81835fae refactor(lsp): message stream abstraction for message framing 2026-05-22 18:20:51 +08:00
Yi Ming
929e644a5a refactor(lsp): move vim.lsp._transport to vim.net._transport 2026-05-22 18:19:19 +08:00
Justin M. Keyes
b576807410 Merge #39939 from marcuscaisey/lsp-completion-details 2026-05-22 04:39:55 -04:00
Maria Solano
71c72c3409 fix(lsp): validate that workspace_edit isn't nil (#39947) 2026-05-21 19:00:02 -07:00
zeertzjq
dee602e659 vim-patch:9.2.0508: completion: cannot complete user cmd :K with 'ignorecase' (#39944)
Problem:  completion: cannot complete user cmd :K with 'ignorecase'
          (rendcrx)
Solution: Skip the short-circuit when 'ignorecase' is set
          (Yasuhiro Matsumoto)

The set_cmd_index() short-circuit for the :k command treats ":k<X>" as
":k {X}" (mark argument), which makes ":kz<Tab>" never reach the
command-name expansion path. With 'ignorecase' the same prefix on other
letters (":gz<Tab>") completes a user command like :Gz, so the result is
inconsistent. Skip the short-circuit when 'ignorecase' is set; default
behaviour is preserved so the existing :k tests still pass.

fixes:  vim/vim#20241
closes: vim/vim#20275

b54e57ee54

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-05-22 08:07:55 +08:00
zeertzjq
2b5d611d6b vim-patch:44a1a6a: runtime(doc): Update wrong shellescape() example
44a1a6a331

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-22 07:40:03 +08:00
zeertzjq
d01cc0b8d0 vim-patch:6845c7a: runtime(doc): fix a typo in :map-local
closes: vim/vim#20276

6845c7a63d

Co-authored-by: nyngwang <nyngwang@gmail.com>
2026-05-22 07:40:03 +08:00
zeertzjq
f7ad2dd19f vim-patch:ff9fd81: runtime(debversions): Add stonking (26.10) as Ubuntu release name
closes: vim/vim#20282

ff9fd819ae

Co-authored-by: Guilherme Puida Moreira <guilherme@puida.xyz>
2026-05-22 07:40:03 +08:00
Marcus Caisey
2845f95171 fix(lsp): advertise that CompletionItem.detail can be resolved (#39934)
Problem:
We can resolve the `CompletionItem.detail` field but don't advertise
this capability.

Solution:
Add `detail` to
`textDocument.completion.completionItem.resolveSupport.properties`.
2026-05-21 13:57:53 -07:00
Marcus Caisey
c75365d22a refactor(lsp): centralise complete item info generation logic
Problem:
The logic for generating the complete item `info` is spread across
`_lsp_to_complete_items`, the `CompleteChanged` event handler, and
`CompletionResolver:request`. This has previously caused the `info`
shown for resolved (via `completionItem/resolve`) and unresolved items
to differ.

Solution:
Centralise the logic in a new `complete_item_info` function which is now
solely responsible for determining:
1. The `info` to show.
2. The markup kind of the `info`.
3. Whether the `info` is complete.

This simplifies the interaction between the 3 functions mentioned in the
problem:
- `_lsp_to_complete_items` calls `complete_item_info` and passes along
  the markup kind and whether the item needs resolving via the complete
  item's `user_data`.
- The `CompleteChanged` consumes the markup kind and whether the
  item needs resolving from the complete item's `user_data`.
- `CompletionResolver:request`, like `_lsp_to_complete_items` calls
  `complete_item_info` again and updates the current `info` if it's
  changed.
2026-05-21 18:22:13 +01:00
Marcus Caisey
d6d03716cf fix(lsp): show detail in popup when server can't completionItem/resolve
Problem:
`CompletionItem.detail` is only shown in the info popup if the server
supports `completionItem/resolve`.

Solution:
If the server doesn't support `completionItem/resolve`, prepend the
complete item `info` with `CompletionItem.detail` in a fenced codeblock,
same as we do when the server supports `completionItem/resolve`.

To ensure that completion items are displayed in the same way,
regardless of whether the server supports `completionItem/resolve`, i've
extracted out the test logic from the `selecting an item triggers
completionItem/resolve + (snippet) preview` case so that we can run the
same tests against a server which supports `completionItem/resolve` and
one which doesn't. Hopefully this should prevent the two behaviours
diverging again.
2026-05-21 18:22:13 +01:00
Marcus Caisey
ce7df01391 fix(lsp): resolve CompletionItem if resolvable fields aren't populated
Problem:
If `CompletionItem.documentation` is populated but `detail` is not, then
`detail` is not resolved.

Solution:
Ensure that we resolve a `CompletionItem` if either `detail` or
`documentation` are not populated.

I've also removed `detail` from the popup menu since otherwise it will
be populated in both the popup menu and the info popup after the
`CompletionItem` has been resolved. I think the info popup is the best
place for it anyway as when there is a completion item with a long popup
menu entry (when `detail` is a medium/long function signature for
instance), the whole popup menu gets widened and this steals horizontal
space that could be used to display the `documentation`. Now with
`detail` and `documentation` in the info popup, they share the same
horizontal space. This also aligns with how VSCode, nvim-cmp, blink.cmp,
and mini.nvim display `detail`.
2026-05-21 18:15:14 +01:00
Marcus Caisey
10a53e7637 fix(lsp): generate snippet preview from resolved textEdit.newText
Problem:
When a resolved `CompletionItem` with kind `Snippet` populates
`textEdit` instead of `insertText`, the contents are not previewed.

Solution:
Generate the snippet preview from `textEdit.newText` as well.
2026-05-21 17:47:08 +01:00
glepnir
7662001c48 fix(float): simplify :bufdelete focus retry #39928
Problem:
Followup to #39858. close_windows returned a holder window just so
do_buffer_ext could retry there, but the non-float branch was dead code
and close_windows was called twice.

Solution:
Check one_window directly in do_buffer_ext, drop the holder, make
close_windows void again.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-05-21 10:38:04 -04:00
Justin M. Keyes
1be55d02f5 fix(net): set buftype=nofile (again) #39930
redux 24e00f2844
2026-05-21 12:46:30 +00:00
luukvbaal
89431707a0 fix(ui2): unable to stop display of very long message #39823
Problem:  Processing of a very long message may take a long time; there
          is no visual feedback of work being done, and no way to abort
          processing.
          Calculating text height for spill indicator inhibits
          performance for very long message.

Solution: Whenever writing part of a message is taking longer than 100ms,
          show the first part of the message, while checking for CTRL-C.
          Calculate ('wrap'-ed) text height accurately until 'lines',
          use line count beyond that.
2026-05-21 05:24:39 -04:00
glepnir
26df751add fix(float): :bufdelete in floatwin may change focus #39858
Problem:
(Followup to 54f22a8f01c0feb27a531b52aedf5cdbd5e51b24.)
Deleting another buffer from a floatwin could move focus into the holder
window and fire BufEnter for the buffer being deleted.

Solution:
Use switch_win_noblock() instead of buf_jump_open_win() before
recursing into do_buffer_ext().
2026-05-21 05:06:50 -04:00
Kyle
7337e02563 refactor(docs): generate tui.txt $NVIM_TERMDEFS keys #39836
Problem:
Potential documentation drift in `tui.txt` if fields for
`$NVIM_TERMDEFS` change.

Solution:
Generate docs for `tui.txt`. Add `brief_xform` to `gen_vimdoc.lua` to
allow transforming briefs during generation.
2026-05-21 04:39:45 -04:00
zeertzjq
a952575c3b vim-patch:9.2.0506: home_replace() function can be improved (#39925)
Problem:  home_replace() function can be improved
Solution: Refactor home_replace() to return the length of the string
          (John Marriott).

In addition:
- in function set_b0_fname() move ulen into the block where it is used.
- In function findswapname() rework logic around displaying "swap file
  already exists" dialogue so that literal message text is set once.

closes: vim/vim#20249

a0931a90ee

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-05-21 09:35:27 +08:00
zeertzjq
74cc0364f1 vim-patch:85eb099: runtime(mbsync): Properly handle values for the "Sync" keyword
This has been manually tested with my personal mbsync configuration and
with the following test file:

    $ cat test.mbsyncrc
    Channel Foo
    # None may not be combined with other operations
    Sync None
    Sync None New
    # First form
    Sync Pull
    Sync Push
    Sync New
    Sync Old
    Sync Upgrade
    Sync ReNew
    Sync Gone
    Sync Delete
    Sync Flags
    Sync Invalid
    # Second form
    Sync PullNew
    Sync PullOld
    Sync PullUpgrade
    Sync PullReNew
    Sync PullGone
    Sync PullDelete
    Sync PullFlags
    Sync PullFull
    Sync PullAll
    Sync PullInvalid
    Sync PushNew
    Sync PushOld
    Sync PushUpgrade
    Sync PushReNew
    Sync PushGone
    Sync PushDelete
    Sync PushFlags
    Sync PushFull
    Sync PushAll
    Sync PushInvalid
    Sync NewInvalid
    # Multiple operations
    Sync New Upgrade Gone Flags
    # Mix of the two styles (an example from the mbsync manpage)
    Sync PullNew PullGone Push
    # Syntaxically correct, though they will raise a warning in mbsync:
    Sync PullNew Pull
    Sync PullNew Gone Push

closes: vim/vim#20243

85eb099bf2

Co-authored-by: Cyril Roelandt <tipecaml@gmail.com>
2026-05-21 08:07:01 +08:00
zeertzjq
040c5deb3f vim-patch:1294861: runtime(getscript,vimball,rust): Use correct shellescape() form for ! ex cmd
Problem:  shellescape() called without {special} flag for :! ex command
Solution: Pass 1 as second argument to shellescape() in :! contexts

related: Commit: 3fb5e58fbc63d86a3e65f1a141b0d67af2 (patch 9.2.0479:
         [security]: runtime(tar): command injection in tar plugin)

129486193c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-21 08:07:01 +08:00
Maria Solano
3883cba996 fix(lsp): flush change notifications on save (#39894) 2026-05-20 16:33:10 -07:00
Justin M. Keyes
9aa4608401 refactor: introduce nvim_on internally #39883
Problem:
`nvim_create_autocmd` is too verbose and its `callback` requires extra
"nesting".

Solution:
Introduce `nvim_on`. Start using it internally. Then we can get a feel
for how it should look before making it public.
2026-05-20 17:33:01 -04:00
Justin M. Keyes
799cbfff85 fix(vim.secure): read() command injection vulnerability #39918
Problem:
Malicious filename can execute code because of ":" cmdline expansion.

Solution:
Use `fnameescape()`.

fix https://github.com/neovim/neovim/issues/39914
2026-05-20 15:27:43 -04:00
Justin M. Keyes
24e00f2844 fix(net): :edit <uri> should set buftype=nofile #39915 2026-05-20 12:36:28 -04:00
Justin M. Keyes
9f0ecad6d9 fix(api): fail fast if has_lua_imp retval looks wrong #39866 2026-05-20 11:52:22 -04:00
Natanael Copa
584dfdb76d fix(test): support multiple --filter-out #39885
fixes regression introduced in commit 55f9c2136e (test: replace busted
with local harness)
2026-05-20 09:03:45 -04:00
Justin M. Keyes
d7cbaf2971 Merge #39876 checkhealth improvements 2026-05-20 08:56:37 -04:00
luukvbaal
53da0c5060 fix(messages): avoid recursive rtp build due to msg_show #39888
Problem:  If there are pending messages when starting to build the
          runtime search path, a msg_show callback may invoke
          runtime_search_path_validate() recursively.
Solution: Avoid msg_show callback by ensuring messages are flushed.
2026-05-20 08:13:41 -04:00
Justin M. Keyes
e446779726 fix(health): "Create bug report" button 2026-05-20 14:09:20 +02:00
Justin M. Keyes
74ea3875b4 fix(health): show Nvim-owned checks at the top 2026-05-20 14:09:20 +02:00
Justin M. Keyes
6674329d15 feat(health): highlight current buffer
Problem:
A benefit of the old `:LspInfo` was that it showed info related to the
"current buffer" a bit more clearly.

Solution:
Highlight the "current buffer" in the LSP checkhealth report.
2026-05-20 14:09:20 +02:00
Justin M. Keyes
7812087341 fix(health): cleanup LSP healthcheck
Problem:
filewatcher and position-encoding info is reported after the big list of
client details.

Solution:
- report the info in the top-level, not in dedicated subsections.
2026-05-20 14:09:20 +02:00
Justin M. Keyes
735a7d0c9e feat(fswatch): report filewatchers in :checkhealth 2026-05-20 14:09:20 +02:00
Matei Stroia
526ae1cc1b fix(fold): virtual lines duplicate foldopen (#39891)
Problem:
Virtual lines above a line where a fold starts show `foldopen` in
`foldcolumn`.

Solution:
Check if the line below the virtual one is inside a fold that starts
higher up or if it's the start of a fold. In the latter case, don't show
anything in `foldcolumn` for the virtual line.

refactor: lint
2026-05-20 19:56:39 +08:00
bfredl
2e82e0bcf6 Merge pull request #39887 from bfredl/o_dod_suss
fix(warnings): annotate or ignore all uses of printf formatting
2026-05-20 12:55:30 +02:00
Olivia Kinnear
f0c3cc2398 fix(pack): collect "Removed plugin" into one message #39840 2026-05-20 06:45:05 -04:00
Justin M. Keyes
1f75fef951 Merge #39889 from ofseed/pos-util
refactor(pos,range): drop `to_cursor`, extract `vim.pos._util`
2026-05-20 05:35:09 -04:00
Justin M. Keyes
f1fad32e2e docs: misc, custom text-object #39877
text-object-define is a pattern I found in tpope's plugins (e.g.
https://github.com/tpope/vim-jdaddy) which shows an elegant way to
define a text-object. (Any mistakes in the example are my fault.)
2026-05-20 05:21:27 -04:00
Yi Ming
cd3b544611 refactor(pos,range): add missing validators and improve the docs
Problem:
Our documentation is incomplete or inconsistent in several ways:
- Some public APIs lack corresponding validators.
- Some public APIs lack usage examples.
- The meaning of some return values or parameters is not clearly explained.

Solution:
Add the missing validators, examples, and clarifications.
2026-05-20 16:23:03 +08:00
Yi Ming
b1c1f32089 refactor(pos,range): extract vim.pos._util
Problem:
- To share logic, creating a `vim.Range` currently creates two `vim.Pos` values
  as intermediates, which causes unnecessary table allocations.
- `pos.lua` and `range.lua` contain some overlapping logic.

Solution:
Add `vim.pos._util`, a module for handling
positions represented directly by `row` and `col`.
2026-05-20 16:23:03 +08:00
Yi Ming
8d1233a144 feat(pos,range)!: remove range.cursor() and range:to_cursor(),
Problem:
- A window can only have one cursor, ranges selected by the cursor are typically
  obtained by marks like ">" and "<", instead of calling get_cursor() twice.
- `vim.Range` is described as end-exclusive,
  but the current `range.cursor()`/`range:to_cursor()` are end-inclusive.
- Conversion between `vim.Range` and mark-indexed range can be done by
  `range.mark()`/`range:to_mark()`

Solution:
Remove `range.cursor()` and `range:to_cursor()`,
2026-05-20 16:23:01 +08:00
Barrett Ruth
5181984db9 fix(api): nvim_exec_autocmds({buf=x}) runs in buffer context #39061
Problem: `nvim_exec_autocmds({ buf = ... })` matches the target buffer, but callbacks and modelines run with the caller buffer current rather than the target buffer.

Solution: Execute the buffered path in prepared target-buffer context and restore the caller afterward.
2026-05-20 03:48:55 -04:00