Commit Graph

36843 Commits

Author SHA1 Message Date
Justin M. Keyes
aeea633deb test(autoread): make "debounce" test actually valid 2026-06-13 20:55:49 +02:00
Justin M. Keyes
1d33a81751 test(autoread): cleanup
- Merged into the main "reloads on external change" test.
- Reduce duplication.
- Wall-clock down from ~4.4s to ~1.4s (dropped 3s debounce test).
2026-06-13 20:54:00 +02:00
Sébastien Hoffmann
e36659c82f fix(statusline): prevent various buffer overflows with item groups #40219
Problem:

Various out-of-bounds writes inherited from vim (examples assume MAXPATHL==4096):
- truncated item groups where minwid>maxwid:
    nvim --clean +"set stl=%<%{%repeat('x',4096-11)%}%50.5(12🙂345%)"
  leads to fillchars spilling over the end of the group/buffer while trying to
  compensate for truncating at a multicell character because minwid<=maxwid is assumed
- left-aligned item groups with multi-byte fillchar:
    nvim --clean +"set fillchars+=stl:∙ stl=%<%{%repeat('x',4096-3)%}%-2(X%)"
  wrongly leads to padding at the end of the statusline and `out_p-out==4097`
  because the bounds check assumes a 1-byte fillchar
- right-aligned item groups with 1-byte fillchar:
    nvim --clean +"set stl=%<%{%repeat('x',4096-4)%}%4(XY%)"
  leads to "YX" instead of "XY" at the end of the statusline
  because `memmove` is done before adjusting the offset
- right-aligned item groups with multi-byte fillchar:
    nvim --clean +"set fillchars+=stl:∙ stl=%5(X%)"
  leads to "∙∙∙∙<e2>", i.e. the fillchar is being written over the group contents
  and eventually being overwritten itself at the second byte with the final NUL,
  because the padding counter assumes a 1-byte fillchar; to crash Neovim,
    nvim --clean +"set fillchars+=stl:∙ stl=%<%{%repeat('x',4096-149)%}%50(X%)"

Solution:
Clearer variable names and no recycling of variables for different purposes.
2026-06-13 13:57:01 -04:00
Evgeni Chasnovski
e9b9426d7d fix(filetype): vim.filetype.match fails if CWD goes missing #40190
Problem: Running `vim.filetype.match()` when current working directory
  was removed from disk throws a `vim.fs.abspath` assertion error.
  However, the matching might still be possible without trying to match
  against full path (like if it is a known extension).

Solution: Safely compute absolute path and ignore it if it errors.
2026-06-13 13:20:45 -04:00
luukvbaal
736f914c7b fix(mouse): click on "below" virtual lines #40217
Problem:  Clicking on a "below" virtual line interacts with the line
          it is attached to for decor/drawing purposes, rather than
          the line the extmark is placed at.
Solution: Account for "below" virtual lines when computing mouse line number.
2026-06-13 12:56:42 -04:00
altermo
67378bfb5a test(undotree): flaky tests #40218
Problem:
After 400f247397 the undotree test became flaky.

It seems to be caused by some kind of race condition where an entry in the undotree is not added when a change in the buffer happens (adding a bunch of sleep around buffer-change operations seems to fix the issue).

Solution:
Disable autoread plugin in undotree test.
2026-06-13 12:49:18 -04:00
John Reid
d52ebe317d feat(diagnostic): add virt_lines_overflow option for virtual_lines #40178
Problem: Diagnostic virtual lines are hardcoded with "scroll" for
virt_lines_overflow option.

Solution: Add a `overflow` option to `virtual_lines` config
to support "wrap", "scroll", "trunc", and "auto".
2026-06-13 04:20:20 -04:00
Jan Edmund Lazo
c5d467323e vim-patch:9.1.0387: Vim9: null value tests not sufficient #40215
Problem:  Vim9: null value tests not sufficient
Solution: Add a more comprehensive test for null values
          (Yegappan Lakshmanan)

closes: vim/vim#14701

da9d345b3d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2026-06-13 04:06:03 -04:00
github-actions[bot]
2c3c6bc7e3 docs: update version.c #40108
vim-patch:9.1.0053: MS-Windows: Key event test still fails
vim-patch:9.1.0057: MS-Windows: Key event test still fails
vim-patch:9.2.0540: tests: Test_mswin_event_mouse is flaky
vim-patch:9.2.0590: GTK4: drawing area loses focus shape on popup menu open
vim-patch:9.2.0595: MS-Windows: Wrong buffer size calculation for gvimext
vim-patch:9.2.0599: popup: title set with popup_setoptions() is not shown
vim-patch:057db5f7e CI: Bump actions/checkout in the github-actions group across 1 directory
vim-patch:48f2e78c8 runtime(doc): Add gtk4-slow doc tag
vim-patch:9e4042b2b translation(it): Update Italian man page
vim-patch:9.2.0604: tests: Test_mswin_event_mouse() is still flaky
vim-patch:9.2.0607: GTK4: inputdialog() does not work as expected
vim-patch:9.2.0613: tests: test_xxd_color2() checks for dash but uses sh
vim-patch:9.2.0616: GTK4: use-after-free on clipboard read timeout
vim-patch:9.2.0617: GvimExt: does not support different runtime dirs
vim-patch:9.2.0618: use-after-free in popup_getoptions() on dict_add() failure
vim-patch:9.2.0619: integer overflow in popup image size validation
vim-patch:0abffbff2 CI: Remove Cirrus CI and Coverity Scan

vim-patch:8.2.2583: Vim9: cannot compare result of getenv() with null
vim-patch:8.2.4087: cannot test items from an autoload script easily
vim-patch:8.2.4534: Vim9: "is" operator with empty string and null returns true

vim-patch:9.0.1674: help for builtin functions is not sorted properly
vim-patch:9.0.1727: minor problems with the teapot
vim-patch:9.0.1796: Vim9 problems with null_objects
vim-patch:9.0.1914: Vim9: few issues when accessing object members
vim-patch:9.0.2001: Vim9: segfault with islocked()

vim-patch:9.1.0385: Vim9: crash with null_class and null_object
vim-patch:9.1.0391: Vim9: could improve testing
vim-patch:9.1.0620: Vim9: segfauls with null objects
vim-patch:9.1.1865: tests: do not notice lines containing only a tab
vim-patch:9.1.2029: tests: the test_vim9_class.vim testfile is too long

vim-patch:9.2.0195: CI: test-suite gets killed for taking too long
2026-06-13 03:59:45 -04:00
Oleksandr Chekhovskyi
400f247397 feat(autoread): use filewatchers for OS-driven change detection #37971
Problem:
The 'autoread' option only checks for file changes reactively — on
FocusGained, :checktime, CmdlineEnter, etc. — by polling timestamps.
External changes are not detected until the user interacts with Neovim.

Solution:
Add a core module (runtime/lua/nvim/autoread.lua) enabled from
runtime/plugin/autoread.lua that watches each buffer's file using
vim._watch.watch() (libuv fs_event). On change detection it calls
:checktime, which invokes the existing buf_check_timestamp() logic
for reload/prompt handling. Watchers are managed via autocmds tied
to buffer lifecycle events and respect the 'autoread' option (global
and buffer-local).
2026-06-12 18:25:15 -04:00
Justin M. Keyes
c622b454b5 Merge #40086 fix(tui): keep synchronized output active across partial flushes 2026-06-12 13:20:39 -04:00
tao
f81da18c3a fix(stdpath): avoid DOS 8.3 filenames for "cache", "run" #40201
Problem:
stdpath() may return a DOS 8.3 "shortened" filename, because Windows
truncates long usernames into `6ch~N` names in `TEMP/TMP` env vars.
We don't want to "leak" them into Nvim.

Solution:
For "run", pass `true` to `vim_FullName` to expand 8.3 filenames.
For "cache", call `os_realpath` to expand 8.3 filenames.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-06-12 11:03:23 -04:00
Justin M. Keyes
baabb7ab6f test: mark non-actionable tests as N/A #40207
Problem:
Listing individual "skipped" notices for each non-actionable or
NVIM_TEST_INTEG test is noisy and makes the "skipped" list overwhelming
and less meaningful.

Solution:
- Mark non-actionable tests with "N/A".
- Report NVIM_TEST_INTEG tests as a separate 1-line summary.
2026-06-12 09:50:27 -04:00
zeertzjq
76cacf6f8b vim-patch:9.2.0623: possible integer overflow in spellfile tree bounds check (#40204)
Problem:  possible integer overflow in spellfile tree bounds check
Solution: Rewrite the overflow check (Devon Krik)

The check 'startidx + len >= maxidx' uses signed int addition and can
overflow when startidx approaches INT_MAX. After overflow the wrapped
result bypasses the guard, allowing the subsequent loop to write
idxs[startidx + i] out of bounds on the heap.

Replace the addition with a safe subtractive check that maintains the
original >= semantics: len >= maxidx - startidx cannot overflow because
both operands are valid indices within [0, maxidx].

This fixes CWE-190 (Integer Overflow) leading to CWE-122 (Heap-based
Buffer Overflow).

closes: vim/vim#20483

276920e138

Co-authored-by: Devon Kirk <hyder365@users.noreply.github.com>
2026-06-12 19:37:44 +08:00
Justin M. Keyes
6f68c872d6 test(windows): unskip some channel/job tests #38515 2026-06-12 07:35:43 -04:00
zeertzjq
00289fa20a vim-patch:9.2.0621: 'autoindent' not stripped with virtualedit=onemore (#40203)
Problem:  'autoindent' not stripped with virtualedit=onemore (after
          9.2.0510).
Solution: Restore the decrement of cursor column when it's on NUL.

fixes:  neovim/neovim#40183
closes: vim/vim#20476

4b13277edd
2026-06-12 18:53:35 +08:00
zeertzjq
8c4578cc4f vim-patch:78094ff: runtime(vim): Update base syntax, simplify function call matching (#40202)
- Explicitly match the dot accessor
- Exclude the qualifier when matching qualified function calls

The dot accessor lookbehind on builtin function calls was slow, matching
across expression based dictionary accessors was visually inconsistent,
and it's arguably more semantically correct.

closes: vim/vim#20481

78094ff1d7

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-06-12 18:38:27 +08:00
Jay Madden
3ed78daf83 perf(lsp): overscan semantic_token range requests #40036
Problem:
Flickering may occur when paging up/down in big files, as ranges for semantic
tokens are requested. This happens with LSP servers like gopls which return
"/full" semantic tokens if the file is too big, where we fall back to
viewport-range token retrievals.

Solution:
Broaden the requested ranges to one viewport of "overscan" on each side plus
some padding if possible:

    (viewport_topline - viewport_height)..(viewport_botline + viewport_height)
2026-06-11 17:16:54 -04:00
Matei Stroia
fe154f4d45 fix(folds): foldcolumn is interrupted for virtual line above nested fold (#39999)
Problem:
`foldcolumn` is empty for virtual lines above the start of a nested
fold.

Solution:
For virtual lines, compute the outer fold level and display it by
reusing the logic from `fill_foldcolumn`.
2026-06-11 13:42:18 +00:00
Justin M. Keyes
8b0060d92f Merge #40173 fix(docs): numbered listitems 2026-06-11 08:58:30 -04:00
Justin M. Keyes
5469fa8038 fix(docs): numbered listitems 2026-06-11 13:35:19 +02:00
Justin M. Keyes
a6584b205c docs: misc 2026-06-11 13:35:19 +02:00
zeertzjq
de10d10d3f vim-patch:9.1.1865: tests: do not notice lines containing only a tab (#40182)
Problem:  tests: test_codestyle does not notice lines containing only a
          tab
Solution: Fix the whitespace issue in eval.txt, update test_codestyle to
          notice such issues (Hirohito Higashi)

closes: vim/vim#18595

5b5290ec02

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-06-11 18:47:57 +08:00
Tomas Slusny
2fd2361a9d fix(startup): use nvim.difftool for nvim -d only for directories #40185
Problem:
`nvim -u NONE -d <(xxd one) <(xxd two)` has weird behavior.
Process substitution `<(...)` is a pipe and not a seekable file.

Test case:

    cat /dev/random | head -c 10240 > one 
    cp one two
    cat /dev/random | head -c 10240 >> two
    nvim -u NONE -d <(xxd one) <(xxd two)

Solution:
Workaround the issue by skipping `nvim.difftool` if the 2 args are not
directories; fall-through to the builtin diff handling.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2026-06-11 06:15:04 -04:00
zeertzjq
d72e91a0b6 Merge pull request #40162 from janlazo/vim-9.1.0944
vim-patch:9.1.{944,1956,1996}
2026-06-11 10:56:54 +08:00
Jan Edmund Lazo
273cad8f8d vim-patch:9.1.1996: tests: test_cmdline.vim leaves swapfiles behind
Problem:  tests: test_cmdline.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!

bf1b41e387

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-10 22:39:35 -04:00
Jan Edmund Lazo
0837ccbf24 vim-patch:9.1.1956: tests: test_sort.vim leaves swapfiles behind
Problem:  tests: test_sort.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!

f8c550fea0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-10 22:32:41 -04:00
Jan Edmund Lazo
29ec44dfc1 vim-patch:9.1.0944: tests: test_registers fails when not run under X11
Problem:  tests: test_registers fails when not run under X11
Solution: filter out warning message

b2a8df35e8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-10 22:31:31 -04:00
zeertzjq
2b8e4f6988 vim-patch:9.2.0620: runtime(netrw): fix 2match pattern rebuild (#40179)
Problem:  unmarking a regular file when there are directories in the markings
          list also removes the 2match highlight from those directories.
Solution: correctly rebuild the match pattern from the remaining markings,
          using the right regex trailer for each entry in the list.

closes: vim/vim#20461

affd4b5964

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-06-11 02:16:15 +00:00
Aaron Tinio
d42f7ee9dc fix(lsp): trailing blank line when edit inserts past end of buffer #40133
Problem:
A text edit positioned entirely past the last buffer line, with
newText ending in a newline, leaves a stray blank line: the
past-the-end path appends the trailing empty fragment produced by
vim.split() and does not set has_eol_text_edit, so the end-of-buffer
cleanup is skipped. Formatting servers emit such edits whenever
formatting moves text to the end of a document.

Regression from ec94014cd1 (#20137), which split the past-the-end
fast path off the clamp path that sets the flag.

Solution:
Set has_eol_text_edit in the past-the-end path, like the adjacent
path that clamps end_row.
2026-06-10 23:25:13 +00:00
Tristan Knight
16549f2f40 fix(lsp): refresh codelens despite pending debounce #40154
Problem:
When a server sends workspace/codeLens/refresh while an automatic codelens
request is already scheduled, Nvim ignores the server refresh. This can leave
rendered codelens text stale until another buffer edit triggers a new request.

Solution:
Cancel the pending automatic request and send the server-requested refresh
immediately. This preserves request coalescing while giving explicit server
refreshes priority.
2026-06-10 19:18:48 -04:00
Barrett Ruth
7c53de949b fix(autocmd): redraw statusline after nvim_exec_autocmds() #40172
Problem:
Since 5181984d, `nvim_exec_autocmds({buf=…})` temporarily sets the
`buf`-window as current-window, and its statusline renders as
a "current-window statusline", regardless of the user's actual
current-window.

Solution:
Mark the statusline for redraw in `aucmd_restbuf()`, so it is redrawn
correctly after the event.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2026-06-10 18:02:03 -04:00
tao
b49492f13c fix(option): set 'shell…' options based on detected shell #40031
Problem:
* 'shellcmdflag' states that its default value is set according to the
  value of 'shell', but this behavior is not yet implemented on Windows.
  The same applies to 'shellpipe', 'shellredir', and 'shellxquote'.
* On Windows, Git is often installed in paths containing spaces, and we
  still do not correctly resolve the sh executable name as described in
  'shell'.
* On Windows, the default value of 'shellslash' is always `false`,
  which causes Unix-like shells to interpret `\` in paths returned by
  some functions as escape charaters.

Solution:
Use a simple rule table to detect common shells (e.g. `cmd`,
`powershell`, shells whose names contain `csh` or `sh`) and apply
best-effort defaults, while leaving more complex scenarios to user
configuration.
2026-06-10 17:28:17 -04:00
Tristan Knight
2899e350ff docs(lsp): bump protocol/meta to 3.18 #37273
fixes glob spec regression related to "zero or more" vs "one or more" for `*`
ref: https://github.com/microsoft/language-server-protocol/issues/2217
2026-06-10 17:02:12 -04:00
tao
7bf2ab4b87 fix(path): nvim_get_runtime_file fails on DOS 8.3 filename #40144
Problem:
stdpath() may return a DOS 8.3 "shortened" filename, because Windows
truncates some long usernames into `6ch~N` names. Then features such
as `nvim_get_runtime_file` fail to find the file.                                         
                                                                                                                    
Analysis:
When expanding an 8.3 filename path like `C:/Users/ADMINI~1/AppData/*`,
we treat `~` as a special character and first check whether a directory
named `ADMINI~1` exists under `Users`. Since no such directory actually
exists, the expansion fails.                                                                                                    
                                                                                                                    
Solution:
Treat `~` as a literal character in `do_path_expand`. Since the `~/`
case is already handled in `gen_expand_wildcards`, any remaining `~` is
just a literal character and will later be escaped to `\~` by
`file_pat_to_reg_pat` if needed.
2026-06-10 07:46:55 -04:00
Christian Clason
61380c5e0a build(wasmtime): don't require exact patch version
Now that wasmtime has introduced LTS releases (and tree-sitter tracks
them), we no longer need to pin the version exactly but can rely on
any major.minor version being compatible. This avoids having to edit
the CMake file on every patch bump.
2026-06-10 13:46:34 +02:00
Christian Clason
9816e9392a build(deps): bump wasmtime to v36.0.9 2026-06-10 11:29:01 +02:00
Christian Clason
02d440da2a build(deps): bump tree-sitter to 519d51148 2026-06-10 11:29:01 +02:00
zeertzjq
cc056d78fb vim-patch:9.1.0581: Various lines are indented inconsistently (#40161)
Problem:  style: Various lines are indented inconsistently
Solution: Retab these lines and correct some comments.
          (zeertzjq)

closes: vim/vim#15259

d9be94cf03
2026-06-10 04:56:22 +00:00
zeertzjq
8b51e50cdc Merge pull request #40160 from janlazo/vim-9.0.2082
vim-patch:9.0.2082,9.1.{95,342}
2026-06-10 11:58:39 +08:00
Jan Edmund Lazo
b402a1221f vim-patch:9.1.0342: tests: test_taglist fails when 'helplang' contains non-english
Problem:  tests: test_taglist fails when 'helplang' contains non-english
Solution: Allow 1 or 2 tagfiles for now (Julio B)

related: vim/vim#14312
closes: vim/vim#14566

ae7e61c928

Co-authored-by: Julio B <julio.bacel@gmail.com>
2026-06-09 23:30:27 -04:00
Jan Edmund Lazo
1c8b988bf7 vim-patch:9.1.0095: tests: test_restricted() fails
Problem:  tests: test_restricted() fails
          (after: v9.1.0091)
Solution: Add a space before the pipecmd and the actual Vim command to
          run

52eb0b8677

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-09 23:17:46 -04:00
Jan Edmund Lazo
4465bb8bc8 vim-patch:9.0.2082: test_channel may fail because of IPv6 config issue
Problem:  test_channel may fail because of IPv6 config issues
Solution: Catch and skip the test, if getaddrinfo() fails with
          'Address family not supported'

Mark tests as skipped when ch_open encounters E901

On some of the Debian build systems, the IPv6 channel tests fail because
`ch_open('[::1]:<port>', ...)` raises the error "E901: getaddrinfo() in
channel_open(): Address family for hostname not supported".

This appears to happen because getaddrinfo() can't perform the reverse
lookup for the ::1, which is a config issue on that system.  Therefore,
instead of reporting a test failure, mark the test as skipped due to the
bad network config

closes: vim/vim#13473

43cb8e1c3b

Co-authored-by: James McCoy <jamessan@jamessan.com>
2026-06-09 22:34:24 -04:00
Jan Edmund Lazo
9708f9ddfb build(vim-patch): test_mswin_event() is N/A (#40158)
Relies on keycode/event handling specific to Windows instead of
"standard (test) API" for all OS.
2026-06-10 01:27:28 +00:00
zeertzjq
268cd370be vim-patch:595d0a7: runtime(doc): wrong {str} length limit in matchfuzzy() docs (#40157)
Problem:  docs say {str} is capped at 256 and longer returns an empty list.
Solution: it's 1024, and {str} plus each candidate are just truncated to
          that, not rejected; fix the text.

closes: vim/vim#20453

595d0a77e4

Co-authored-by: glepnir <glephunter@gmail.com>
2026-06-10 01:18:26 +00:00
zeertzjq
51d59b2244 vim-patch:9.2.0605: tests: Test_screenpos() is flaky in GUI (#40156)
Problem:  Test_screenpos() fails intermittently in the GUI testgui CI
          job with "Expected {'row': 22} but got {'row': 23}".  In the
          GUI, the window height reported by getwininfo() before the
          final redraw can be stale, so the cached wininfo.height does
          not match the actual window height when the assertion runs.
Solution: Use winheight(winid) at assertion time so the height reflects
          the window state after the redraw.

closes: vim/vim#20457

781a91ac54

Co-authored-by: thinca <thinca@gmail.com>
2026-06-10 08:47:13 +08:00
zeertzjq
d4e6f92f52 vim-patch:9.2.0610: cindent: closing brace in a comment affects the next line's indent (#40155)
Problem:  A '}' inside a // line comment changes the indentation of the
          following line inside an enum or struct (rendcrx).
Solution: Stop scanning the line once a line comment is reached, so a brace
          inside the comment is no longer mistaken for an unmatched brace.

fixes:  vim/vim#20455
closes: vim/vim#20458

9dd86dff9b

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 07:37:08 +08:00
dependabot[bot]
5a9a357bf0 ci: bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6.0.2...v6.0.3)

Updates `github/codeql-action` from 4.36.0 to 4.36.1
- [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.0...v4.36.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 18:41:29 +02:00
Riccardo Mazzarini
b23ef0f8d7 refactor(tui): consolidate buffer flushing into a single function 2026-06-09 16:08:04 +02:00
zeertzjq
fcd2adf8ae test: virt_lines_overflow=wrap with virt_lines_leftcol (#40147) 2026-06-09 02:30:38 +00:00