2097 Commits

Author SHA1 Message Date
zeertzjq
61eddb3fe7 vim-patch:9.2.0523: tests: no test for using shellescape() in combination with :! (#39972)
Problem:  tests: no test for using shellescape() in combination with :!
Solution: Add a test that checks runtime files for using wrong
          combination of shellescape() with ! ex command

This has lead to a few security relevant issues, so add a test that
checks all runtime files for any ! followed by a shellescape() that does
not use the {special} arg.

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

closes: vim/vim#20286

Supported by AI

fccc2adc98

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-24 09:29:50 +08:00
zeertzjq
1a064abb0a vim-patch:9.2.0517: quickfix: can set quickfixtextfunc in restricted/sandbox mode (#39970)
Problem:  quickfix: can set quickfixtextfunc in restricted/sandbox mode
          (tacdm)
Solution: Disallow setting the quickfixtextfunc option from a sandbox
          and restricted mode (Yegappan Lakshmanan).

closes: vim/vim#20305

cb8510d470


Co-Authored-by: tacdm

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2026-05-24 08:49:02 +08:00
zeertzjq
b6b2b12494 vim-patch:9.2.0515: virtualedit=insert doesn't work during change operation (#39968)
Problem:  virtualedit=insert doesn't work during change operation
          (after 6.1.014).
Solution: Make virtual_op only affect virtualedit=block (zeertzjq).

related: neovim/neovim#35391
closes:  vim/vim#20298

3d0a6073e5
2026-05-23 23:59:08 +00:00
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>
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
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
3bc21c0903 vim-patch:9.2.0502: runtime(netrw): bookmark handling can be improved (#39900)
Problem:  To goto or delete a bookmark, one needs to prefix a count
          for the bookmark number (e.g., "2gb" to open bookmark#2).
          As the bookmark list gets or deletes entries, the numbers
          keep changing, requiring listing the bookmarks with qb to
          discover the desired bookmark number. Typing gb or mB
          without a count targets g:netrw_bookmarklist[-1].
Solution: If no count is given to gb or mB, list all bookmarks and
          prompt for a number using inputlist(), similar to tag jump
          with g].

closes: vim/vim#20211

35b767a090

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-20 01:12:12 +00:00
zeertzjq
f3bb21e71d vim-patch:9.2.0500: filetype: some html files wrongly recognized as htmlangular (#39880)
Problem:  filetype: some html files are wrongly recognized as htmlangular
Solution: Use the \< atom to anchor ng-template and ng-content to start
          of word (truffle)

Prevent false-positive htmlangular detection on words containing
'ng-template' or 'ng-content' as a substring (e.g. 'song-template',
'sing-content'). Anchor both branches with \< to require a word start,
matching the \<DTD\s\+XHTML\s idiom used five lines below.

related: neovim/neovim#39778.
closes:  vim/vim#20246

354ab1a69e

Co-authored-by: truffle <truffleagent@gmail.com>
2026-05-19 08:42:05 +08:00
zeertzjq
7b46848f14 vim-patch:9.2.0494: User commands cannot handle single args with spaces (#39854)
Problem:  User commands cannot handle single args with spaces
Solution: Add the -nargs=_ attribute (Maxim Kim)

-nargs=_ allow user commands to have a single argument with spaces.

For example given the following Test command and TestComplete function:

```
vim9script
def TestComplete(A: string, _: string, _: number): list<string>
    var all = ["qqqq", "aaaa", "qq aa"]
    return all->matchfuzzy(A)
enddef
command! -nargs=_ -complete=customlist,TestComplete Test echo <q-args>
```

`:Test q a<tab>` should successfully complete `qq aa`

fixes:  vim/vim#20102
closes: vim/vim#20189

f0e874a129

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-05-18 17:44:26 +08:00
zeertzjq
878718fa76 vim-patch:9.2.0496: [security]: Code Injection in cucumber filetype plugin
Problem:  [security]: Code Injection in cucumber filetype plugin
          (Christopher Lusk)
Solution: Use rubys Regexp.new() with the untrusted pattern

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4473-94jm-w5x9

a65a52d684

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-18 08:11:18 +08:00
zeertzjq
a7d3835cb9 vim-patch:9.2.0495: [security]: runtime(netrw): code injection via NetrwBookHistSave()
Problem:  [security]: runtime(netrw): code injection via
          NetrwBookHistSave()
Solution: Properly quote the directory name using string() function
          (Srinivas Piskala Ganesh Babu)

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c

f08ab2f4d7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-18 08:11:18 +08:00
zeertzjq
b92ca58d69 vim-patch:9.2.0490: matchfuzzy() can crash on long multi-word patterns (#39809)
Problem:  matchfuzzy() can crash on long multi-word patterns.
Solution: Clamp pat_chars to maxMatches and stop before calling
          match_positions() when the buffer is full (glepnir).

closes: vim/vim#20209

88b00d1c57

Co-authored-by: glepnir <glephunter@gmail.com>
2026-05-16 18:28:42 +08:00
zeertzjq
925b14ce2b vim-patch:9.2.0489: filetype: some Objective-C files are not recognized
Problem:  filetype: some Objective-C files are not recognized
Solution: Add g:filetype_mm override variable, improve the objective c
          pattern detection (Keith Smiley).

closes: vim/vim#20221

bc7f736a39

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2026-05-16 16:54:11 +08:00
zeertzjq
1813e1c089 vim-patch:9.2.0486: out-of-bound read when recovering swap files (#39807)
Problem:  out-of-bound read when recovering corrupted swap files
          (Rahul Hoysala)
Solution: Validate the db_txt_start field when recovering a swap
          file.

Supported by AI

de7a5b5425

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-16 08:07:22 +08:00
zeertzjq
10432d0df8 vim-patch:9.2.0481: runtime(netrw): command injection possible via maps
Problem:  runtime(netrw): command injection possible via crafted
          directory names in NetrwMaps() (Christopher Lusk)
Solution: Temporarily remove B flag in NetrwMaps() to prevent command
          injection

8e41c34aba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-15 09:09:35 +08:00
zeertzjq
86c5703111 vim-patch:9.2.0480: [security]: runtime(netrw): code injection via mf command
Problem:  [security]: runtime(netrw): code injection via mf command
          (Christopher Lusk, Zdenek Dohnal)
Solution: Do not use string concatenation inside the filter() commands
          (Zdenek Dohnal)

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-66hr-7p6x-x5j3

8af0f098c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-15 09:05:59 +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
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
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
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
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
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
zeertzjq
ffe87d91f7 vim-patch:9.2.0458: Crash with invalid shellredir/shellpipe value (#39691)
Problem:  Crash with invalid shellredir/shellpipe value
          (bfredl)
Solution: Validate the option and allow only a single "%s".

fixes:  vim/vim#20157
closes: vim/vim#20159

84ae09dd79

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-09 01:13:19 +00:00
zeertzjq
900975d30d vim-patch:9.2.0455: 'findfunc' only allows extra info for cmdline completion
Problem:  'findfunc' only allows extra info for cmdline completion, not
          for actually finding files (Maxim Kim, after 9.2.0451).
Solution: Handle returning a list of dicts when actually finding files.
          Also fix crash on NULL string (zeertzjq).

fixes:  vim/vim#20163
closes: vim/vim#20164

9694ff58fe
2026-05-09 08:05:56 +08:00
zeertzjq
3aa83dca41 vim-patch:9.2.0454: tests: no test that "abbr" in customlist completion is shown
Problem:  No test that "abbr" in customlist completion is shown in pum.
Solution: Add some "abbr" fields to the existing test (zeertzjq).

closes: vim/vim#20165

b207b5a2a3
2026-05-09 08:05:48 +08:00
zeertzjq
bf173c3e88 vim-patch:9.2.0451: 'findfunc' can't return extra info for cmdline completion
Problem:  'findfunc' can't return extra info for cmdline completion
          (Maxim Kim).
Solution: Handle 'findfunc' return value in cmdline completion like that
          of "customlist" functions (zeertzjq).

fixes:  vim/vim#20155
closes: vim/vim#20158

58124789aa
2026-05-09 08:05:46 +08:00
zeertzjq
0976ce255b vim-patch:9.2.0450: [security]: heap buffer overflow in spellfile.c read_compound() (#39660)
Problem:  read_compound() in spellfile.c computes the size of the regex
          pattern buffer using signed-int arithmetic on the attacker
          controlled SN_COMPOUND sectionlen.  With sectionlen=0x40000008
          and UTF-8 encoding active the multiplication wraps to 27 while
          the per-byte loop writes up to ~1B bytes, overflowing the heap.
          Reachable when loading a crafted .spl file (e.g. via 'set spell'
          after a modeline sets 'spelllang').  The cp/ap/crp allocations
          have the same int + 1 overflow class (Daniel Cervera)
Solution: Use type size_t as buffer size and reject values larger than
          COMPOUND_MAX_LEN (100000).  Apply the same size_t treatment to
          the cp/ap/crp allocations.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q4jv-r9gj-6cwv

9299332917

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 23:03:20 +00:00
zeertzjq
d9a7b68795 vim-patch:9.2.0447: cindent does not ignore comments (#39622)
Problem:  When find_start_brace() scans backwards for the enclosing
          block, '{' and '}' inside // and /* */ comments are counted,
          producing wrong indent for code following such comments
          (rendcrx).
Solution: Implement FM_SKIPCOMM in findmatchlimit() to track block-
          comment state and skip matches inside comments. Pass
          FM_SKIPCOMM from cindent's call sites
          (find_start_brace, find_match_char, cin_iswhileofdo,
          get_c_indent).

fixes:  vim/vim#4
fixes:  vim/vim#648
fixes:  vim/vim#19578
closes: vim/vim#19581
closes: vim/vim#20111

c06002f3cb

Co-authored-by: magnus-rattlehead <magnus-rattlehead@users.noreply.github.com>
2026-05-06 01:45:18 +00:00
zeertzjq
cfa803d895 vim-patch:9.2.0446: runtime(netrw): off-by-one bug in s:NetrwUnMarkFile() (#39620)
Problem:  off-by-one bug in s:NetrwUnMarkFile()
Solution: Correctly loop through all buffers to unlet all variables
          (J. Paulo Seibt)

When the function loops through buffers to clear s:netrwmarkfilelist_#
and s:netrwmarkfilemtch_#, it skips the last one at bufnr('$'), messing
up mark highlights and causing other functions that operate on those
arrays (like delete or rename) to target stale marked files.

The bufnr() help page says that bufnr("$") returns the highest buffer
number of existing buffers, so while ibuf < bufnr("$") does not clear
the last buffer-local arrays.

To reproduce:

Just opening a fresh Vim and running :Ex opens a netrw buffer at the
highest number. Then, typing mu after marking some files triggers the
mark highlight bug, and finally typing D would act like calling the
delete function against the previous marked files, as the buffer-local
arrays where not touched by s:NetrwUnMarkFile.

closes: vim/vim#20129

7ccc273a4c

Co-authored-by: J. Paulo Seibt <jpseibt@gmail.com>
2026-05-06 09:23:22 +08:00
zeertzjq
2bb426ce4a vim-patch:9.2.0443: GUI: cancelling save dialog overwrites or discards unnamed buffer (#39617)
Problem:  When closing gvim with an unsaved unnamed buffer, choosing
          "Yes" in the "Save changes?" dialog and then "Cancel" in the
          file selection dialog either silently writes the buffer to a
          file named "Untitled" (overwriting any existing file with
          that name) or discards the buffer altogether
          (vibs29, after v9.1.0265).
Solution: In dialog_changed(), if browse_save_fname() leaves the buffer
          without a file name, treat it as a cancel and return without
          saving.  Also stop clearing the modified flag in the restore
          path on write failure, so the unsaved changes are kept and
          the caller (e.g. gui_shell_closed()) can also cancel the
          close.  Pre-fill the file dialog with "Untitled" to match
          the preceding "Save changes to ..." prompt.  Add a test for
          the write-failure path (Hirohito Higashi).

fixes:  vim/vim#20132
closes: vim/vim#20143

cf947e7ef0

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-05-06 08:19:30 +08:00
zeertzjq
d1c3d6fbaa vim-patch:9.2.0444: Cannot set 'path' option via modeline
Problem:  Cannot set 'path' option via modeline (zeertzjq, after v9.2.0435)
Solution: Revert the part that disallows setting 'path' via modeline.

closes: vim/vim#20137

88fb739918

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-06 07:25:00 +08:00
zeertzjq
b06f8b174f vim-patch:9.2.0435: [security]: backticks in 'path' may cause shell execution on completion
Problem:  [security]: Backticks enclosed shell commands in the 'path'
          option value are executed during completion (q1uf3ng).
Solution: Skip path entries containing backticks, add P_SECURE to 'path'
          option, so that it cannot be set from a modeline (for symmetry with
          the 'cdpath' option)

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-hwg5-3cxw-wvvg

Supported by AI.

190cb3c2b9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-06 07:23:07 +08:00
zeertzjq
d0582fcc74 vim-patch:9.2.0442: completion: i_CTRL-X_CTRL-V doesn't use dict from customlist (#39614)
Problem:  Completion with i_CTRL-X_CTRL-V doesn't use dict from cmdline
          "customlist" completion.
Solution: Include abbr/kind/menu/info in the completion items
          (zeertzjq).

closes: vim/vim#20139

2bfddbea47
2026-05-05 23:17:21 +00:00
zeertzjq
64249d2f2a vim-patch:9.2.0438: tests: test_plugin_termdebug is flaky
Problem:  Test_termdebug_tbreak(), Test_termdebug_basic(), and
          Test_termdebug_toggle_break() use synchronous assert_equal()
          to check breakpoint signs immediately after sending commands
          to gdb.  On slow CI (ASAN, ARM64, macOS) gdb may not have
          processed the response yet, causing the sign to be missing.
Solution: Wrap the three assertions in WaitForAssert() to poll until
          the signs are placed, matching the pattern already used by
          the other assertions in the same tests (Jesse Rosenstock).

closes: vim/vim#20133

20a124a6e0

Co-authored-by: Jesse Rosenstock <jmr@google.com>
Co-authored-by: Gemini
2026-05-05 10:29:49 +08:00
zeertzjq
ddee275c69 vim-patch:9.1.1756: termdebug: Need a few more user commands
Problem:  termdebug: Need a few more user commands
Solution: Add the :RunOrContinue and the :ToggleBreak user commands
          (bennyyip)

closes: vim/vim#18283

c975d62473

Co-authored-by: bennyyip <yebenmy@gmail.com>
2026-05-05 10:29:49 +08:00
zeertzjq
b4b93605aa vim-patch:9.2.0439: completion: info popup not removed in cmdline mode (#39595)
Problem:  Info popup isn't removed when selecting an item that doesn't
          have "info" in cmdline completion, which is inconsistent with
          Insert mode behavior.
Solution: Set pum_call_update_screen in cmdline mode (zeertzjq).

closes: vim/vim#20128

3bfffcc290

Nvim already behaves correctly. Add a screen test as there are none.
2026-05-04 23:02:20 +00:00
zeertzjq
7fff439395 vim-patch:9.2.0433: customlist completion cannot supply pum metadata (#39584)
Problem:  customlist completion cannot supply pum metadata
Solution: Allow each item returned by a customlist function to be
          either a string or a Dict with keys "word", "abbr", "kind",
          "menu" and "info" (Yasuhiro Matsumoto).

closes: vim/vim#20100

5c700152ae

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-05-04 11:47:54 +08:00
zeertzjq
0e69a38026 vim-patch:9.2.0436: Buffer overflow when parsing overlong errorformat lines (#39578)
Problem:  When an error line in a file passed to :cfile / :cgetfile is
          longer than IOSIZE, qf_parse_file_pfx() copies the tail
          into the fixed-size IObuff with STRMOVE(), overflowing the heap buffer.
          The same code path can also loop indefinitely because
          qf_parse_file_pfx() always returns QF_MULTISCAN when a
          tail is present, and qf_init_ext() unconditionally goes
          to "restofline" without bounding the tail length (Nabih).
Solution: Remove the STRMOVE() into IObuff.  In the QF_MULTISCAN
          branch, alias linebuf into the tail directly and update
          linelen, requiring strict progress (new length less than
          the previous length) before retrying; otherwise ignore
          the line.

closes: vim/vim#20126

Supported by AI

77677c33de

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-05-04 07:20:16 +08:00
zeertzjq
14819d55fb vim-patch:9.2.0430: tests: Test_shortmess_F3() is flaky on MS-Windows
Problem:  tests: Test_shortmess_F3() is flaky on MS-Windows
Solution: Increase the sleep to 3s (Yasuhiro Matsumoto)

On MS-Windows time_differs() treats mtime as unchanged unless st_mtime
differs by more than 1 second, so a 2-second sleep can fall short when
the two writes straddle a second boundary. Bump the non-nanotime sleep
to 3 seconds.

closes: vim/vim#20117

2219c89013

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-05-03 07:21:59 +08:00
zeertzjq
57bd41da4d vim-patch:9.2.0429: tests: flaky screendump Test_smoothscroll_incsearch()
Problem:  tests: flaky screendump Test_smoothscroll_incsearch()
Solution: Replace screendump test by WaitForAssert()
          (Yasuhiro Matsumoto)

VerifyScreenDump fails consistently on the macos-15-intel CI runner.
Replace the dump comparisons with assertions that verify the actual
invariant under test: that the visible buffer view stays unchanged
across the four incremental-search keystrokes (i.e. skipcol is not
reset). Drop the now-unused dump files.

closes: vim/vim#20118

e25933014c

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-05-03 07:21:59 +08:00
Justin M. Keyes
d788dd2811 refactor(excmd): pass fargs to Lua for builtin cmds #39528
Problem:
The fallback that tokenizes `eap->arg` by unescaped whitespace (when the
parser doesn't pre-split via `EX_EXPAND` etc.) lives in `nlua_do_ucmd`,
so only user-command callbacks got `eap.fargs`. Builtin commands routed
through `nlua_call_excmd` have to re-parse the args themselves
(e.g. `M.ex_lsp`).

Solution:
- Move the tokenization into `nlua_push_eap` so every Lua handler sees
  `eap.fargs`. Keep only the `EX_NOSPC` override in `nlua_do_ucmd` (the
  `nargs=1`/`?` case which is genuinely user-command-specific).
- Drop the re-parse in `M.ex_lsp`.
2026-05-02 10:46:23 -04:00
zeertzjq
ec671a2d51 vim-patch:9.2.0425: Cannot silence undo/redo messages (#39554)
Problem:  Cannot silence undo/redo messages
Solution: Add "u" flag to 'shortmess' option
          (Shougo Matsushita).

fixes:  vim/vim#20049
closes: vim/vim#20107

d25f8d1b2c

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2026-05-02 12:55:14 +08:00
glepnir
941f2f9522 vim-patch:9.2.0418: wildcards in expanded env vars reinterpreted by glob (#39517)
Problem:  With $d='[dir]', `:e $d/file.txt` opens the wrong file,
          `:e $d/<Tab>` fails to complete, and `glob('$d/*')` returns
          nothing. Wildcard characters inside expanded environment
          variables get picked up by globbing again.
Solution: Turn the 4th parameter of expand_env_esc() from a bool into a
          string of characters to escape in each expanded value. Callers
          that pass the result to wildcard expansion should include
          PATH_ESC_WILDCARDS in addition to " \t" (glepnir).

closes: vim/vim#20053

20e98ff1cc
2026-05-02 10:51:44 +08:00
zeertzjq
668ccd97b6 vim-patch:9.2.0416: Unix: filename completion splits at space for single-file Ex commands (#39520)
Problem:  SPACE_IN_FILENAME is defined on most platforms but not on Unix.
	  As a result, set_context_for_wildcard_arg() on Unix always resets the
	  completion pattern at white space for Ex commands that take a
          single file argument.
Solution: Drop the SPACE_IN_FILENAME ifdef (Maxim Kim)

fixes:  vim/vim#18411
closes: vim/vim#20090

c2bda0add9

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-04-30 13:11:49 +00:00
zeertzjq
071f9748c0 vim-patch:9.2.0415: Wrong behavior when executing register that ends in Insert mode (#39518)
Problem:  Wrong behavior when executing register that ends in Insert
          mode from Ctrl-O (Emilien Breton)
Solution: Use :startinsert etc. to restore Insert mode after executing
          the register contents (zeertzjq).

fixes:  vim/vim#20085
closes: vim/vim#20091

6453a7c440
2026-04-30 11:14:28 +00:00
glepnir
c79d5f5028 vim-patch:9.2.0417: completion: no support for "noinsert" with 'wildmode' (#39516)
Problem:  completion: no support for "noinsert" with 'wildmode' and
          commandline completion
Solution: Add "noinsert" value to the 'wildmode' option, mirroring
          'completeopt' "noinsert" behaviour (glepnir).

fixes:  vim/vim#16551
closes: vim/vim#20080

af494af5ff
2026-04-30 11:13:47 +00:00
zeertzjq
0697c24601 vim-patch:9.2.0413: Scrolling wrong with 'splitkeep' when changing 'cmdheight' (#39493)
Problem:  Cursor is not adjusted when 'cmdheight' is changed to cover
          the cursor with 'splitkeep' ~= "cursor".
Solution: Handle window resize for 'splitkeep' after changing 'cmdheight'.
          Ensure previous window height is set when changing 'splitkeep'
          (Luuk van Baal).

closes: vim/vim#20043

bd0f3e6da5

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2026-04-29 13:42:02 +08:00
zeertzjq
f04dc2fcfc vim-patch:9.2.0408: Insert-mode <Cmd> edits can corrupt undo (#39492)
Problem:  A <Cmd> command in Insert mode can edit the current buffer,
          e.g., with setline(). That edit appends to the current undo
          block, but Insert mode does not know that the cursor line may
          need to be saved again before the next typed edit. If the next
          typed edit is a <BS> at the start of a line, it can join away
          the line that was changed by the <Cmd> command before Insert
          mode saves that updated line. The newest undo entry can then
          still refer to the joined-away line, so undo sees a range past
          the end of the buffer and fails with E438.
Solution: If a <Cmd> command in Insert mode changes the buffer, set
          ins_need_undo so stop_arrow() refreshes Insstart. This lets
          the next edit properly decide whether a new undo entry is
          needed (Jaehwang Jung)

closes: vim/vim#20087
AI-assisted: Codex

e47daed442

Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2026-04-29 13:09:55 +08:00
zeertzjq
c33e60f748 revert: "vim-patch:9.2.0405: when jumping to tags, will open URLs (#39461)" (#39487)
This reverts commit 72bc6c5801.

Fix #39480
2026-04-28 23:18:02 +00:00