Commit Graph

37276 Commits

Author SHA1 Message Date
Kyle
28818702e9 fix(tui): urxvt reset cursor style #40800
Problem:
urxvt doesn't support resetting to default cursor style like we assumed.
https://github.com/neovim/neovim/issues/38987#issuecomment-5004636437

Solution:
Instead of the reset sequence, always set it to steady block. This will
still be wrong for users who configured their initial cursor to
underline, but it's about the best we can do.
2026-07-17 21:07:58 -04:00
glepnir
9fae7234f6 feat(completion): support completionList.applyKind #40769
Problem: values from completionList.itemDefaults always replace the
item's own commitCharacters and data. Since 3.18 a server can ask for
them to be merged instead.

Solution: Handle CompletionList.applyKind and advertise applyKindSupport.
Drop itemDefaults once folded into the items: get_items() runs twice on
the same result and a Merge isn't idempotent.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#completionItemApplyKinds
2026-07-17 21:07:01 -04:00
zeertzjq
a2e36d8df8 vim-patch:528adbd: runtime(netrw): Fix reset_ssl reference error on file rename (#40799)
fixes:  vim/vim#20710
closes: vim/vim#20777
closes: vim/vim#20698

528adbd757

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
Co-authored-by: Doruk Özer <dorukozer@protonmail.com>
2026-07-18 06:44:43 +08:00
zeertzjq
844f045078 vim-patch:9.2.0783: tests: personal spell files leak into later tests (#40798)
Problem:  Test_spelldump_prefixtree_overflow() resets 'runtimepath' to
          defaults, which can expose personal spell files to later tests
          (Jun-ichi Takimoto, after v9.2.0662)
Solution: Save and restore the test runner's 'runtimepath' value (coyaSONG).

fixes:  vim/vim#20765
closes: vim/vim#20766

f16e30e19d

Co-authored-by: coyaSONG <66289470+coyaSONG@users.noreply.github.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
2026-07-18 06:41:02 +08:00
Justin M. Keyes
a373466cd9 test: unreliable "bumps 'busy' on each watched buffer" #40794
Problem:
Test still unreliable.

Solution:
Don't require both 'busy' pulses to coincide.

followup to #40775
2026-07-17 16:45:11 -04:00
Justin M. Keyes
e0e7f65b74 refactor(detach): eliminate nvim__ui_detach #40793
Problem:
`nvim__ui_detach` was added in 85e0559d46 in order to implement
`detach_others` from Lua. Using Lua in this case is doing more harm than
good.

Solution:
Extract `ui_detach_channel`, which also allows it to be used for the
"self detach" path from `ex_detach`.

Bonus: the old MSWIN path always called `os_swap_to_hidden_console()`;
now `ui_detach_channel` only does so for a stdio channel. For the common
stdio TUI this is identical; for a socket UI it's more correct (no
parent console to swap).
2026-07-17 16:37:45 -04:00
Jason Woodland
85e0559d46 feat(ui): ":%detach!" detaches all other UIs #39216
Problem:
Not easy for one UI to kick the others off a shared Nvim server.

Solution:
Treat `:%detach` as detach-other-UIs.
2026-07-17 15:23:34 -04:00
MAAZIZ Adel Ayoub
9d3edf345f fix(path): avoid shell fallback for unknown users #40757
Problem:
Expanding an unknown ~user path falls back to the shell. In a fast event,
this re-enters the event loop and aborts Nvim.

Solution:
Leave unknown users unexpanded when the system account lookup fails.
2026-07-17 14:21:29 -04:00
Olivia Kinnear
ed5dcc0edf fix(restart): messages EXX error codes #40759 2026-07-17 13:52:56 -04:00
dependabot[bot]
e86c63189b ci: bump github/codeql-action from 4.36.3 to 4.37.0 in the github-actions group across 1 directory (#40755)
ci: bump github/codeql-action

Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.36.3 to 4.37.0
- [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.36.3...v4.37.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-17 12:43:02 -04:00
Jan Edmund Lazo
0d92bf3761 build(vim-patch): '#ifdef FEAT_' tweaking is N/A #40785
Filter out `#ifdef` line changes when analyzing C files (*.c, *.h)
via git "-I" flag.

```
-I<regex>
--ignore-matching-lines=<regex>
Ignore changes whose all lines match <regex>. This option may be specified more than once.
```

- https://git-scm.com/docs/diff-options#Documentation/diff-options.txt--Iregex
2026-07-17 07:16:31 -04:00
Olivia Kinnear
58fe621cfc feat(health): rearrange vim.ui.img checks #40782 2026-07-17 07:09:04 -04:00
Justin M. Keyes
d36d05cbd5 refactor(globals): group Visual-mode globals in VisualState #40777 2026-07-16 20:38:44 -04:00
Justin M. Keyes
4d90288c69 test: unreliable "bumps 'busy' on each watched buffer" #40775 2026-07-16 17:25:28 -04:00
Justin M. Keyes
9bfa337899 Merge #39485 refactor(globals): SearchState 2026-07-16 16:11:36 -04:00
Justin M. Keyes
81926f04b4 refactor(search): SearchState 2026-07-16 21:39:40 +02:00
carladams1299-lab
b80e01e10a refactor(globals): group search state into SearchState struct 2026-07-16 21:35:01 +02:00
Barrett Ruth
9edf57e665 fix(dir): custom 3P directory-browser #40725
Problem:
Third-party directory browsers do not have a documented way to take over local
directory buffers from nvim.dir.

Solution:
Document deleting the nvim.dir augroup and handling FileType directory as the
after-startup handoff, and avoid installing the built-in buffer-local "-" mapping
when "-" is already mapped.
2026-07-16 14:26:01 -04:00
jdrouhard
c15ac3d64c fix(lsp): capability cleanup #40763 2026-07-16 13:08:47 -04:00
Curnic Dorin
a297985d05 fix(messages): show hint in E77 error #40765 2026-07-16 10:23:27 -04:00
zeertzjq
7c091348af test(api/ui_spec): fix flaky test (#40767)
The poke_eventloop() and screen:expect() sometimes don't run the test
runner's event loop long enough for the data to arrive at the reading
end of the pipe. Use a screen:expect_unchanged() so that the event loop
can run a bit longer.

FAILED   ...ovim/build/Xtest_xdg_api/test/functional/api/ui_spec.lua @ 105: nvim_ui_send works with stdout_tty
Expected values to be equal.
Expected:
"\27]11;?\7Hello world"
Actual:
"\27]11;?\7"
stack traceback:
	...ovim/build/Xtest_xdg_api/test/functional/api/ui_spec.lua:138: in function <...ovim/build/Xtest_xdg_api/test/functional/api/ui_spec.lua:105>
2026-07-16 19:36:13 +08:00
Jan Edmund Lazo
16c25e8aee vim-patch:8.2.4955: text property in wrong position after auto-indent (#40766)
Problem:    Text property in wrong position after auto-indent.
Solution:   Adjust text property columns. (closes vim/vim#10422, closes vim/vim#7719)

788c06a249

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2026-07-16 06:48:20 +00:00
Sean Dewar
1741da8412 fix(window): yeet grid later when closing float in other tabpage #40758
Problem: #40731 may still crash if close_buffer autocmds reinsert the float's
grid. Plus removing the grid (and posting win_close) is unneeded if
win_close_othertab refuses to close the window later, which is possible.

Solution: do the stuff before freeing the window, like win_close.
2026-07-15 19:09:54 -04:00
glepnir
5ce9e74f13 feat(completion): commitCharacters #38417
Problem: LSP completion commitCharacters are not handled. Typing a
commit character (e.g. `.`, `(`, `;`) while a completion item is
selected does not accept the item first.

Solution: Store commit characters as a flat string in complete-items.
Check it before completion stops, accept the match and let
the character be inserted normally.
2026-07-15 19:08:37 -04:00
Olivia Kinnear
4f1ef2dec1 fix(restart): keep :restart error message concise #40746 2026-07-15 19:05:46 -04:00
Justin M. Keyes
31ad7d4527 Merge #40621 fix(ui2)!: legacy 'ruler' inconsistencies 2026-07-15 08:13:37 -04:00
phanium
6f370f34f2 fix(window): remove float grid from compositor layers before free #40731
Problem: Closing a floating window from a non-current tab frees its grid
without removing it from the compositor's `layers` table, so the next
`ui_comp_put_grid()` walks a dangling pointer (UAF).

Solution: Call `ui_comp_remove_grid()` (and `ui_call_win_close()` for
multigrid UIs) before `win_free_mem()`, matching `win_close()` since
PR #21551.
2026-07-15 07:48:34 -04:00
jdrouhard
44d5593afd refactor(lsp): unify LspNotify, decor provider for capabilities #40691
Problem: Every LSP capability that sends a request on a document change
to update its state was using its own buffer-local autocmd to do so.
That means there is a separate autocmd per buffer per active
capability/feature, and the actual code inside the autocmd callback was
virtually identical. The same problem occurred for capabilities that had
components to draw on the screen that had their own decoration providers.

Solution: Introduce a central `LspNotify` autocmd and decoration
provider in the capability module itself. New base class methods
`on_close` and `on_change` that take a client_id have been provided, for
`didClose` and `didOpen`/`didChange` notifications respectively. New
base class method `on_win` that takes topline and botline has been
provided to add extmarks or perform other work when lines of a buffer
are being drawn.

The autocmd callback loops through each active capability instance for
the buffer and calls a corresponding method with the triggering
client_id if it is currently attached to the buffer that triggered the
autocmd. The decoration provider just calls on_win for all active
capabilities on the buffer.

This slightly tweaks folding range to make use of these new client-id
specific callbacks.
2026-07-15 07:07:17 -04:00
Robert Muir
4bc30d6e10 fix(lsp): improve inlayHint.resolveSupport in client capabilities #40741
Problem
The current list of properties for inlay hint resolve support includes a
non-existent "location". This field should be "label.location" according
to the specification. Tooltips and commands for inlay hint "parts"
aren't advertised as being resolvable.

Solution
Remove "location" and add "label.location", "label.tooltip", and
"label.command".

Closes #40740
2026-07-15 06:49:45 -04:00
Barrett Ruth
b2570e6852 fix(showcmd): avoid stale %S contents #40747
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2026-07-15 06:10:09 -04:00
Justin M. Keyes
671e9d4913 feat(marks): :marks completion, list extmarks #40743
Problem:
- No UI for listing extmarks.
- `:marks` doesn't support cmdline-completion.

Solution:
- Add completion and extmarks support to `:marks`.
- Update `get_buf_local_marks` to include the ":" (prompt-buffer) mark.
2026-07-15 05:55:51 -04:00
zeertzjq
f17dfc9ab3 test: fix typo (#40750) 2026-07-15 07:55:01 +00:00
zeertzjq
39bc59a8f1 fix(floatwin): don't use same window as altwin (#40748)
Fixes a regression from #34486
Fix #40745
2026-07-15 05:59:45 +00:00
Barrett Ruth
4b69d3fd2d test: adjust exit waits for slow CI (#40739) 2026-07-15 05:37:28 +08:00
Justin M. Keyes
9cbb8e24c7 Merge #40728 from janlazo/na-runtime-datetime-1liner
build(vim-patch): N/A runtime/doc/*.txt changes
2026-07-14 10:28:01 -04:00
Christian Clason
b10da8b377 build(deps): bump luajit to 3c4f9fe20 2026-07-14 11:51:05 +02:00
Jan Edmund Lazo
02290ba155 build(vim-patch): detect patch v8.2.0000 as N/A
Following features must be N/A to detect v8.Y.0000 as N/A

- VisVim
- Windows *.def files
- Gvim
- runtime/doc/version8.txt ("too old")
  (https://github.com/neovim/neovim/pull/1116 deletes version7.txt)
2026-07-14 01:34:44 -04:00
Jan Edmund Lazo
2e9b06caf7 build(vim-patch): N/A runtime/doc/*.txt changes
Vim's runtime/doc/*.txt may change the 1st line only
for publish datetime.
Nvim removed those datetimes.

TODO - src/version.h for vX.Y.0000 patch.
2026-07-14 01:03:57 -04:00
Jan Edmund Lazo
60cbdc7996 build(vim-patch): src/version.h is N/A #40730
PR https://github.com/neovim/neovim/pull/36585 enabled
"scripts/vim-patch.sh", "scripts/vimpatch.lua" to optimize out
(all?) macros from Vim's "src/version.h".
If it does have relevant updates, then the applicable files
(ie. src/version.c) will use them to make the patch applicable.

Goal - Detect N/A patches for Vim release vX.Y.0000.
2026-07-13 21:26:08 -04:00
Barrett Ruth
0bb2f5cc08 fix(ftplugin): source inherited Lua ftplugins
Problem:
Vimscript ftplugins that inherit a base ftplugin often use explicit
`runtime! ftplugin/foo.vim` patterns. This skips corresponding Lua
ftplugins, unlike top-level ftplugin loading.

Solution:
Use the existing `{vim,lua}` patterns for bang runtime imports while
preserving each call's current lookup breadth.
2026-07-14 00:18:50 +02:00
Barrett Ruth
fd02e91319 fix(ftplugin): port checkhealth ftplugin to Lua 2026-07-14 00:18:50 +02:00
Justin M. Keyes
eb94149a29 refactor(vimscript)!: drop ctxget(), ctxpush(), etc #40724
Problem:
This functions are most likely never used in the wild.
- They are redundant with `nvim_get_context` + `nvim_load_context`.
- The "context" concept was never fully developed and hasn't gained
  traction.

Solution:
Drop these vimscript aliases, they are just extra cruft.
2026-07-13 17:57:13 -04:00
Justin M. Keyes
06ded1330c refactor(core): group Visual-mode globals in VisualExtent #40722 2026-07-13 16:19:32 -04:00
Barrett Ruth
73bb6a8a5e fix(dir): let 3P dir-browser plugin rename the dir buffer #40529
Problem:
`FileType directory` fires *before* the `BufEnter` path where `dir.lua`
populates the buffer, in order to allow a 3P dir-browser plugin to handle the
event and (optionally) rename the buffer to e.g. `example:///tmp/foo/`.

But currently, `open_buffer()` continues after `filetypedetect BufRead` as if
the original directory buffer is *still* current and valid, which may fall
through to the built-in `nvim.dir` path after a 3P plugin ALREADY handled the
directory.

Solution:
Keep a buf ref around the early `filetypedetect BufRead` call for directory
buffers.

If the `FileType directory` handler switches away from/deletes the original
directory buffer, stop the open path instead of continuing into the built-in
`nvim.dir` flow.
2026-07-13 15:10:19 -04:00
Justin M. Keyes
4d736cd41f Merge #40721 from justinmk/refactor 2026-07-13 14:35:23 -04:00
Justin M. Keyes
fe794153ed feat(docs): mark optional API parameters 2026-07-13 20:01:55 +02:00
Justin M. Keyes
9982f6e0e4 refactor(api): omit optional param 2026-07-13 19:44:15 +02:00
Justin M. Keyes
dc8934482e feat(api): optional params after opts #40720
Problem:
After 25439dad7e, `opts` is optional, but not params that follow it.

Solution:
- Update `gen_api_dispatch.lua`, docs, tests.
- Enhance the `nvim_get_api_info()` api-metadata to include a boolean
  flag indicating whether a parameter is optional:
  ```
  [type, name, optional]
  ```

Note: Currently, optional params are assumed to be Dict/Array. Since we
don't yet have any use-cases of optional params following `opts`, the
build just checks this assumption and we can deal with it later if we
ever care to:

    nvim_get_hl: optional param "foo" has type "Integer" but (currently)
    we assume Dict/Array
2026-07-13 13:43:49 -04:00
dependabot[bot]
01d1ee330f ci: bump actions/labeler in the github-actions group across 1 directory
Bumps the github-actions group with 1 update in the / directory: [actions/labeler](https://github.com/actions/labeler).


Updates `actions/labeler` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-13 17:46:54 +02:00
Justin M. Keyes
f50f421694 test(pack): unreliable "vim.pack" tests on Windows #40717
FAILED   …/plugin/pack_spec.lua:92: …/plugin/pack_spec.lua @ 70: vim.pack update() can use lockfile revision as a target
    …/plugin/pack_spec.lua:92: …/plugin/pack_spec.lua:70: process still exists
    stack traceback:
    D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system_sync'
    …/plugin/pack_spec.lua:92: in function 'git_cmd'
    …/plugin/pack_spec.lua:113: in function 'git_add_commit'
    …/plugin/pack_spec.lua:1209: in function <…/plugin/pack_spec.lua:1173>

fix #40167
2026-07-13 10:49:48 -04:00