Commit Graph

36545 Commits

Author SHA1 Message Date
Justin M. Keyes
6bb3e1b239 test(vim.fs): basename(), dirname() trim trailing slashes #39790
close #37698
2026-05-14 16:02:31 -04:00
Justin M. Keyes
adb5d8a646 build(test): declaration specifier expected near '_Static_assert' #39788
Problem:
On "arm clang unittest" CI job, `make unittest` sometimes fails with
lots of these messages:

    FAILED   test/unit/testutil.lua @ 773: ...
    test/unit/testutil.lua:773:
    test/unit/testutil.lua:297: declaration specifier expected near '_Static_assert' at line 429
    exit code: 256
    stack traceback:
    test/unit/testutil.lua:773: in function 'itp_parent'
    test/unit/testutil.lua:811: in function <test/unit/testutil.lua:801>

Solution:
Update filter_complex_blocks.
2026-05-14 14:42:22 -04:00
Justin M. Keyes
4f27b585e9 docs: dev, lsp, indent-guides #39756
- document "indent guides" https://github.com/neovim/neovim/issues/39726
- document guidance for "subcommands" https://github.com/neovim/neovim/issues/32263#issuecomment-4436002808

Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
2026-05-14 13:13:30 -04:00
Justin M. Keyes
c7f5f44b60 refactor(vim.fs): deduplicate by using vim.fn #39782
Problem:
61e99217e6 replaced usages of `vim.fn`. This duplicates non-trivial
logic and may have introduced bugs like 38e38d1b40.

Later on, b02eeb6a72 graduated `fnamemodify` to `fast`, so avoiding it
in `vim.fs` is no longer necessary.

Solution:
Use `vim.fn` to deduplicate `vim.fs.dirname()` and `vim.fs.basename()`.

Note: the "nvim -l" test-runner switch from the original PR (#30483) is
already done by 9432e6c1e2 (#39676).
2026-05-14 13:02:36 -04:00
dependabot[bot]
8b7b0a5cd6 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.35.3 to 4.35.4
- [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.3...v4.35.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-14 14:54:52 +02:00
Michele Campeotto
6780e78b09 feat(highlights): new Dimmed hl group for de-emphasized text #39505
Problem:
Many color schemes assume the Comment hl group is dim text and use it
for secondary text, decorations, or parts of UI. This is true for many
color schemes but not all.

Solution:
Introducing a new highlight group with a more specific meaning, similar
to Underlined or Ignore.

The new group links to Comment by default so the behavior is unchanged
for color schemes that don't define it.
2026-05-13 15:54:34 -04:00
github-actions[bot]
d3f3d75451 docs: update version.c #39663
vim-patch:fbec828c7 CI: Bump the github-actions group across 1 directory with 2 updates
vim-patch:852f4f43c runtime(doc): Fix manpage typo in description of '--ttyfail'
vim-patch:9.2.0472: popup: column jitters when scrolled outside viewport
vim-patch:9.2.0474: MS-Windows: hard to tell which Visual Studio version was selected with MSVC
vim-patch:78302b7b4 translation(it): Update Italian manpage
vim-patch:9.2.0477: popup: leftover content after popup_free under layout change
vim-patch:9.2.0478: channel: redundant str/length assignments in channel_part_info()

vim-patch:9.2.0460: did_set_shellpipe_redir() in wrong file
vim-patch:9.0.2153: no support to build on OpenVMS
vim-patch:9.2.0290: Amiga: no support for AmigaOS 3.x
2026-05-13 15:44:19 -04:00
dependabot[bot]
912f228f82 ci: bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [actions/create-github-app-token](https://github.com/actions/create-github-app-token) and [korthout/backport-action](https://github.com/korthout/backport-action).


Updates `actions/create-github-app-token` from 3 to 3.1.1
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/create-github-app-token/compare/v3...v3.1.1)

Updates `korthout/backport-action` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](7c3f6cd584...bf97bcfb53)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 3.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: korthout/backport-action
  dependency-version: 4.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 14:55:12 +02:00
Lewis Russell
9432e6c1e2 test: run Lua harness with nvim -l
Problem:
The Lua test harness still ran through standalone -ll mode, so tests
depended on the low-level Lua path instead of the regular Nvim Lua
environment. That also meant os.exit() coverage had to carry an ASAN
workaround because Lua's raw process exit skipped Nvim teardown and let
LeakSanitizer interfere with the observed exit code.

Solution:
Run the harness and related fixtures with nvim -l. Patch os.exit() in
the main Lua state to exit through getout(), so scripts observe normal
Nvim shutdown while standalone -ll remains available for generator-style
scripts. As a consequence, the startup test can assert os.exit() without
disabling leak detection.

AI-assisted: Codex
2026-05-13 13:14:07 +01:00
luukvbaal
706cbbff33 fix(grid): keep grid sizes updated during redraw #39757
Problem:  Assert tripped when window is resized during update_screen().
Solution: Re-allocate grid when resizing happens during update_screen().
2026-05-13 07:46:30 -04:00
Nathan Zeng
dbdd73e846 refactor(tutor): use inline comments instead of json file #39714
Problem: Expected text for interactive marks is in a separate json file
from the tutor file. When the tutor file is updated, line numbers
(potentially many) have to be updated in the json file. This is a
burden for maintenance and automatic testing.

Solution: Put the expected text inline in the tutor file, marked
with `[[]]`. Parse and remove the comments before opening the tutor
file so extmarks can be applied.
2026-05-13 07:31:17 -04:00
dependabot[bot]
8b11734b18 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.0.1 to 6.1.0
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v6.0.1...v6.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 08:49:42 +02:00
zeertzjq
89b5a1a181 fix(ui_client): fix memory leak (#39770) 2026-05-13 10:25:43 +08:00
yilisharcs
6c21a72b85 vim-patch:702d32e: runtime(compiler): set zig errorformat (#39769)
includes a new zig_cc file to catch warnings

closes: vim/vim#20198

702d32e161
2026-05-13 01:17:44 +00:00
zeertzjq
3b3d3076f7 vim-patch:9.2.0476: pattern completion leaks memory on alloc failures (#39767)
Problem:  copy_substring_from_pos() leaked on ga_grow() failures,
          expand_pattern_in_buf() leaked "match" on ga_grow() failure,
          fuzzy_match_str_with_pos() ignored ga_grow() failures
Solution: Route failures through cleanup paths, check ga_grow before
          writing to ga_data (glepnir)

closes: vim/vim#20203

38237411e4

Co-authored-by: glepnir <glephunter@gmail.com>
2026-05-13 08:56:18 +08:00
zeertzjq
228e6ca32a Merge pull request #39741 from zeertzjq/vim-9.2.0470
vim-patch:9.2.{0470,0473}: TextPut{Pre,Post}
2026-05-13 07:51:11 +08:00
zeertzjq
986382069a refactor: make nvim_put() trigger TextPut* with '_' as regname 2026-05-13 06:57:07 +08:00
zeertzjq
58184d3fa3 vim-patch:9.2.0473: Pasting ". register without autocommands breaks TextPut*
Problem:  Pasting ". register without TextPut* autocommands breaks
          subsequent TextPut* autocommands (after 9.2.0470).
Solution: Only decrement add_last_insert if it has been incremented
          (zeertzjq).

closes: vim/vim#20192

a70b7a85af
2026-05-13 06:57:07 +08:00
zeertzjq
871b4b1642 vim-patch:9.2.0470: No way to hook into put commands
Problem:  No way to hook into put commands
          (yochem)
Solution: Introduce TextPutPre and TextPutPost autocommands
          (Foxe Chen).

fixes:  vim/vim#18701
closes: vim/vim#20144

e0781bd5bf

Co-authored-by: Foxe Chen <chen.foxe@gmail.com>
2026-05-13 06:57:07 +08:00
luukvbaal
de67f93aea fix(messages): fast context for for nvim_echo({kind}) callback #39755
Problem:  vim.ui_attach() callback for nvim_echo() call that spoofs an
          internal message kind is executed in fast context.

Solution: Set msg_show callback |api-fast| context dynamically at
          external message callsites, and for internal list_cmd",
          "progress" and "shell*" messages.
2026-05-12 16:28:54 -04:00
Tomas Slusny
a977e1077b fix(prompt): handle multi-element lists in prompt_appendbuf #39550
Problem:
When using prompt_appendbuf with multi-element list,
the first item is concated and rest replace the prompt instead of
inserting the lines before the prompt.

Solution:
Concat first element with replace_buf and insert the rest of the list
with set_buffer_lines.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2026-05-12 12:00:04 -04:00
li
807f3703c4 refactor(main.c): unused "cwd" variable #39751 2026-05-12 15:45:01 +00:00
bfredl
7673adc952 Merge pull request #38675 from bfredl/errdefer
feat(ui_client): "press ENTER" free nvim crashes
2026-05-12 11:00:26 +02:00
zeertzjq
492b8c9e9c vim-patch:9.2.0475: runtime(netrw): bookmark paths not normalized (#39748)
Problem:  the bookmarks list can have duplicate entries, more often
          in win32 (due to mixed slashes and capitalization) and when
          g:netrw_keepdir=0 (which could introduce relative paths).
          Duplicate entries could be: C:\foo\BAR\baz.file
                                     c:\foo\bar\baz.file
                                     c:/foo\BAR/baz.file
                                     BAR/baz.file
Solution: Normalize the paths and make sure they are always absolute
          (J. Paulo Seibt).

closes: vim/vim#20194

74019bea8c

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-11 23:52:44 +00:00
zeertzjq
b51cf60c8d vim-patch:9.2.0471: vimvars di_key initialized at runtime (#39747)
Problem:  evalvars_init() copies each vimvar's name into di_key at
          startup and runtime-checks that the name fits in
          DICTITEM16_KEY_LEN, even though all names are known at
          compile time.
Solution: Embed the name in di_key via the VV_NAME macro so the
          initialization happens at compile time.  Drop the
          runtime length check and the STRCPY loop (John Marriott).

closes: vim/vim#20185

1b65cfbac5

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-05-11 23:51:42 +00:00
luukvbaal
5f7237f54b fix(ui2): unable to route by message ID #39734
Problem:  - "bufwrite" message identifier is encoded in the message ID
            of a "progress" kind message (since ff68fd6b); UI2 does not
            allow routing by message ID.
          - No documented way to set a default message target for all
            but a few kinds (without copying all of |ui-messages| kinds
            to cfg.msg.targets).
          - A user adding a message route for the documented empty ""
            kind can result in unexpected behavior.
          - Showing duplicate message (x) indicator in msg and cmd
            targets simultaneously is unsupported.
          - Manually triggering CursorMoved autocommand to add matchparen
            highlighting in the cmdline.
Solution: - Match cfg.msg.targets keys as Lua pattern to a message ID.
          - Recognize "default" as key in cfg.msg.targets, drop the
            undocumented cfg.msg.target field.
          - Don't try to get configured target for "" message kind/trigger.
          - Maintain msg indicator virtual text for the cmd and msg target.
          - Add matchparen highlighting by directly calling the Lua module
            (possible since b813c7e0).
2026-05-11 18:17:04 -04:00
luukvbaal
96fc7c150f fix(api): don't update 'title' when renaming non-curbuf #39743
Problem:  'title' is updated when changing the name of a non-current
          buffer with nvim_buf_set_name().
Solution: Set RedrawingDisabled when renaming the buffer.
2026-05-11 15:54:55 -04:00
luukvbaal
ce9f4f0369 fix(messages): reset redirection message column after :echon #39472
Problem:  Message redirection column for captured output is not reset
          after :echon since (4260f73, e63346df).

Solution: Ensure msg_ext_append is set before the kind with :echon.
2026-05-11 15:47:19 -04:00
Marcus Caisey
c4285acb92 fix(health): set 'tags' for help filetype #39742
Problem:
The `:checkhealth` buffer uses the help syntax, so help tag links (e.g.
`|clipboard|`) are highlighted like they are in help buffers. However,
unlike in help buffers, `CTRL-]` doesn't jump to the relevant help file.

I expect that if the `:checkhealth` buffer looks like a help buffer,
then it should behave like one where it makes sense. This comment from
/r/neovim suggests that this was the intention:
https://www.reddit.com/r/neovim/comments/5ghv3r/see_clipboard_how/dascnry/.

Solution:
Set `'tags'` in `checkhealth` buffers so that `:tag` and friends look
for tags in the help tags files.
2026-05-11 15:14:52 -04:00
Justin M. Keyes
11084f5db3 Merge #39730 from ofseed/lsp-remove-deprecated 2026-05-11 11:34:09 -04:00
bfredl
8275b7b491 Merge pull request #39736 from bfredl/odod
fix(style): some clang-tidy 22 fixes
2026-05-11 16:27:14 +02:00
zeertzjq
41e8201c6c fix(terminal): memory leak when pasting '=' register (#39738)
Problem:  Memory leak when pasting '=' register in terminal.
Solution: Free the register.
2026-05-11 13:07:39 +00:00
Yi Ming
9e5982f071 refactor(lsp)!: always require position_encoding 2026-05-11 20:37:56 +08:00
bfredl
7e9015fecb fix(style): some clang-tidy 22 fixes
CI currently uses clang-tidy 20, but this affects local builds
and CI is going to be upgraded sooner or later.

Some remaining systematic issues:

- clang-tidy warns agains any atoi() or atol() usage (because of no
  error handling)

- functions which takes (char *fmt, char *only_string_arg) and expect
  fmt to contain exactly one "%s" usage.

- error: initializing non-local variable with non-const expression depending on
  uninitialized non-local variable (cppcoreguidelines-interfaces-global-init)

  This is a much worse problem in C++ (hence C++ core guidelines) where
  initialization is intermingled with arbitrary code execution. I
  "think" in plain C, the linker will either resolve all these
  deterministically or barf an error. But with some restructuring
  we could make all static initialization actually static..
2026-05-11 13:31:10 +02:00
zeertzjq
17e737ed93 vim-patch:partial:9.2.0341: some functions can be run from the sandbox (#39733)
Problem:  some functions can be run from the sandbox
Solution: Block them, so they are not accessible from a modeline
          (q1uf3ng)

closes: vim/vim#19975

fcc4276db3

Co-authored-by: q1uf3ng <q1uf3ng@protone.me>
2026-05-11 10:21:16 +00:00
zeertzjq
5e756aa825 vim-patch:bfebd12: runtime(javacc): Check for existence of javaFuncDef syn group before clearing it (#39731)
fixes: vim/vim#20190

bfebd1209b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-11 17:20:40 +08:00
bfredl
9c42db1181 feat(ui_client): "press ENTER" free nvim crash debugging
This feature might be a little silly and niche, but it is very useful
for _my_ workflow (and open source is about mee)

An issue which is never present on high quality RELEASE builds, but
might occur on Debug builds is that the Nvim server crashes
on some error in your unfinished PR code. If you compile your debug
builds with sanitizers enabled, as you should, the ASAN/UBSAN runtime
will print some useful info about your mistake to stderr or a log file,
such as a stack trace. This can be used to jump to the error in the
code.

This allows the nvim server to install a signal hander in the ui client,
which can load this log file in a good safe version of nvim and parse it
using 'errorformat'

This is inspired by the "press ENTER" free workflow of ui2 and applies
it beyond the lifetime cycle of the nvim instance.

example config:
```lua
    local asan = vim.env.ASAN_OPTIONS
    if asan ~= nil and string.match(asan, "log_path=/tmp/nvim_asan")  then
      local myname = "/tmp/nvim_asan."..vim.uv.getpid()

      local args = {"--embed", "-n", "+set efm=%+A%*[^/]%f:%l:%c", "+silent cfile "..myname, "+silent cfirst", "+silent copen"}

      vim.api.nvim__set_restart_on_crash("nvim", args)
    end
```

and run your debug nvim like so

    ASAN_OPTIONS=handle_abort=1,handle_sigill=1,log_path=/tmp/nvim_asan ./build/bin/nvim
2026-05-11 11:00:03 +02:00
Yi Ming
fd51fb3fa0 refactor!: remove deprecated APIs 2026-05-11 16:51:58 +08:00
zeertzjq
0e7d51a378 vim-patch:9.2.0464: runtime(netrw): bookmarking directory uses current dir (#39729)
Problem:  runtime(netrw): bookmarking directory uses current dir
Solution: Correctly handle netrw actual directory (J. Paulo Seibt)

fixes:  vim/vim#10481
closes: vim/vim#20169

ec76ac620b

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-11 05:08:02 +00:00
Justin M. Keyes
5370eb0146 fix(lua): vim.wait(0) does not call loop_poll #39679
Problem:
Regression from c822a2657c: `vim.wait(0)` does not call `loop_poll`,
so `vim.wait(1)` is needed to "yield" from Lua.

Solution:
- Ensure that `vim._core.loop_poll()` is always called, even when `time=0`.
- Document how to interrupt Lua code (ctrl-c).

ref https://github.com/neovim/neovim/issues/6800
2026-05-10 14:22:31 -04:00
Yi Ming
c2d7dd781a feat(lsp): pass arbitrary positions to vim.lsp.buf #39446
Problem:
Currently, it only supports sending requests using the current cursor position as a parameter.

Solution:
Support sending requests using arbitrary positions.
2026-05-10 13:49:36 -04:00
Justin M. Keyes
1f4ad7808e docs: misc, window #39720
- formalize `window-number` similar to `tabpage-number`.
- reference it from docs.
2026-05-10 13:00:52 -04:00
Yi Ming
eb79cf5aee feat(logging): vim.log #38906 2026-05-10 11:03:15 -04:00
glepnir
2dc0efccb0 fix(snippet): cancel session on <Esc> in Select mode #39238
Problem: <Esc> in a Select-mode tabstop leaves the session and highlight active.
CursorMoved isn’t triggered since the cursor doesn’t move.

Solution: use ModeChanged (s:n) instead. Defer with vim.schedule() to avoid transient
s:n from jump().
2026-05-10 09:19:12 -04:00
Olivia Kinnear
5d1910e1e0 fix(luarc.json): increase workspace.preloadFileSize #39711
Problem:
When using the default `lua_ls` config from nvim-lspconfig, the following info message gets printed:

```
LSP[lua_ls] Too large file: src/nvim/eval.lua skipped. The currently set size limit is: 500 KB, and the file size is: 511.133 KB.
```

Solution:
Set `workspace.preloadFileSize` to 1000 KB instead of the default 500 KB.
2026-05-10 08:11:20 -04:00
Maria Solano
2acf27e5ff fix(diagnostic): handle signs = false in status() (#39703) 2026-05-09 17:59:21 -07:00
zeertzjq
2d5f56c0aa vim-patch:9.2.0461: Corrupted undofile causes use-after-free (#39707)
Problem:  The four pointer-resolution loops in u_read_undo() lack
          an i != j guard, so a header whose uh_next.seq equals
          its own uh_seq resolves uh_next.ptr to itself.  On
          buffer close, u_freeheader() sees uhp->uh_next.ptr !=
          NULL and skips updating b_u_oldhead, so u_blockfree()
          dereferences the freed header on the next iteration.
          The same pattern applies to uh_prev, uh_alt_next and
          uh_alt_prev.  A crafted .un~ file in the same directory
          as a text file can trigger the use-after-free and
          subsequent double-free when the buffer is closed.
          (Daniel Cervera)
Solution: Add an i != j guard to each of the four resolution
          loops, matching the guard already present in the
          duplicate-detection loop above.

closes: vim/vim#20168

Supported by AI

4f610f07b7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-10 08:06:07 +08:00
Will Lillis
b44c2bdd16 fix(treesitter): remove default match limit (#39696)
Problem: The default match limit of 256 can be too low for realistic
use cases, but was necessary to guard against catastrophic
performance cliffs.

Solution: Performance cliffs were fixed in upstream tree-sitter 0.27+,
so remove the fallback limit to return unlimited matches by default.
2026-05-09 10:19:21 +00:00
Christian Clason
ef84ec69aa fix(matchparen): remove redundant vimscript shim
Problem: #39625 retained `matchparen.vim` as a shim that sources the new
`matchparen.lua` entrypoint, which is redundant since Lua runtime/plugin
files are sourced automatically and incurs startuptime cost solely for
the sake of not touching the tests.

Solution: Remove the shim and `source` the Lua plugin in directly in
tests.
2026-05-09 10:01:40 +02:00
Nathan Zeng
db7f818728 refactor(defaults): use public treesitter select()
Problem: Default mappings use the private module.

Solution: Use the public method.
2026-05-09 10:00:03 +02:00