Commit Graph

2018 Commits

Author SHA1 Message Date
zeertzjq
0e07b2a1e2 vim-patch:9.2.0357: [security]: command injection via backticks in tag files (#39102)
Problem:  [security]: command injection via backticks in tag files
          (Srinivas Piskala Ganesh Babu, Andy Ngo)
Solution: Disallow backticks before attempting to expand filenames.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-cwgx-gcj7-6qh8

Supported by AI

c78194e41d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-16 11:11:29 +08:00
zeertzjq
766efe5b51 vim-patch:9.2.0354: filetype: not all Bitbake include files are recognized
Problem:  filetype: not all Bitbake include files are recognized
Solution: Enhance the file detection logic and consider varflags
          (Martin Schwan)

closes: vim/vim#19983

0e02be1919

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2026-04-16 10:28:01 +08:00
zeertzjq
c3c06723f0 vim-patch:9.2.0355: runtime(tar): missing path traversal checks in tar#Extract() (#39095)
Problem:  runtime(tar): missing path traversal checks in tar#Extract()
Solution: Add check for leading slash, however gnu tar should already
          detect this (q1uf3ng)

tar#Extract() did not check for ../ sequences or absolute paths,
unlike zip#Extract() which was patched in recent commits. Add the
same checks: ../ (relative traversal), leading slash (Unix), drive
letter and UNC/leading slash (Windows).

closes: vim/vim#19981

490b737f3e

Co-authored-by: q1uf3ng <q1uf3ng@protone.me>
2026-04-16 08:40:41 +08:00
zeertzjq
202e17deef vim-patch:9.2.0346: Wrong cursor position when entering command line window (#39072)
Problem:  Wrong cursor position when entering command line window
Solution: Add check_cursor() command to verify the cursor position
          (Hirohito Higashi).

When opening the command-line window with CTRL-F after typing a command
that fills the screen width, the cursor was placed past the end of the
line.  Add check_cursor() after setting State to MODE_NORMAL so the
cursor is adjusted to the last character.

Also fix the cmdwin prefix character (e.g. ':') being drawn on wrapped
continuation rows.  Draw an empty space instead so that the text
alignment is preserved.

closes: vim/vim#19964

c4fe1e958a

Cherry-pick Test_wildmenu_pum() changes from patch 9.1.1995.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:22:05 +08:00
zeertzjq
e0eb967f8a vim-patch:partial:9.2.0348: potential buffer underrun when setting statusline like option (#39063)
Problem:  potential buffer underrun when settings statusline like option
          (q1uf3ng)
Solution: Validate that p > out before accessing p[-1]

closes: vim/vim#19961

91b402f575

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-14 23:59:17 +00:00
zeertzjq
8fdac3d08d vim-patch:9.2.0343: tests: test_clientserver may fail on slower systems
Problem:  tests: test_clientserver may fail on slower systems
Solution: Wait for argc() before checking argv() (James McCoy).

On slower systems, the argv() check may run before the server has
populated the arg list.

Add a wait for argc() to be 3 to be more tolerant of such systems

closes: vim/vim#19974

9d95410aa4

Co-authored-by: James McCoy <jamessan@jamessan.com>
2026-04-15 07:21:21 +08:00
zeertzjq
504aa9253a vim-patch:9.2.0342: tests: test_excmd.vim leaves swapfiles behind
Problem:  tests: test_excmd.vim leaves swapfiles behind
Solution: Close open buffer using :bw!

related: vim/vim#19975

c922202ea2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-15 07:21:21 +08:00
zeertzjq
65680f59d1 vim-patch:9.2.0345: Wrong autoformatting with 'autocomplete' (#39060)
Problem:  Wrong autoformatting with 'autocomplete'.
Solution: Don't trigger autoformatting when ending autocompletion
          without selecting an item (zeertzjq).

fixes:  vim/vim#19954
closes: vim/vim#19970

efbd482116
2026-04-14 23:03:34 +00:00
glepnir
53a29dce0e feat(completion): completeopt=preselect, LSP CompletionItem.preselect #36613
Problem: 
LSP CompletionItem.preselect is not supported.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities

Solution:
- Add "preselect" field to complete-items and "preselect" flag
  to 'completeopt'.
- Set preselectSupport=true in LSP client capabilities.
2026-04-13 05:59:07 -04:00
Jan Edmund Lazo
09d4eba92b vim-patch:9.0.0856: MS-Windows: executable not found when running test (#39002)
Problem:    MS-Windows: executable not found when running individual test.
Solution:   Also look for vimd.exe. (Christopher Plewright, closes vim/vim#11525)

d55bfcaa9b

Co-authored-by: Christopher Plewright <chris@createng.com>
2026-04-13 05:19:35 +00:00
Jan Edmund Lazo
bbd880ca2e vim-patch:9.0.0354: MS-Windows: starting a python server for test sometimes fails (#38998)
Problem:    MS-Windows: starting a python server for test sometimes fails.
Solution:   Increase the waiting time for the port.

a906e8e1ab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-13 01:30:33 +00:00
Barrett Ruth
6e95d1ad13 fix(normal): pass count to 'keywordprg' as arg1 #38965
Problem:
If `'keywordprg'` begins with `:`, `3K` turns the count into an Ex
range. Commands that don't support that then fail. Vim passes the count
as the first arg (see #19436, vim/vim#10745).

Solution:
Pass `[count]` as the first arg for `'keywordprg'`.
2026-04-12 08:44:56 -04:00
Jan Edmund Lazo
4a289bfce3 vim-patch:8.2.2035: MS-Windows: some tests may fail (#38969)
Problem:    MS-Windows: some tests may fail.
Solution:   Avoid test failures. (Yegappan Lakshmanan, closes vim/vim#7346)

f637bceb61

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-12 07:10:28 +08:00
Jan Edmund Lazo
56fe6713ca vim-patch:8.2.0904: assuming modifyOtherKeys for rhs of mapping (#38970)
Problem:    Assuming modifyOtherKeys for rhs of mapping.
Solution:   Ignore seenModifyOtherKeys for mapped characters. (closes vim/vim#6200)

46cd43bda1

----

"getchar.c" changes depend on patch 8.1.2145.
Can't port it due to tests.
"test_gui.vim" doesn't depend on GUI for all tests.

----

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-12 07:07:16 +08:00
zeertzjq
c4b592a6d0 vim-patch:9.2.0333: filetype: PklProject files are not recognized (#38949)
Problem:  filetype: PklProject files are not recognized
Solution: Detect PklProject files as pkl filetype
          (Nihaal Sangha).

Reference:
https://pkl-lang.org/
https://github.com/apple/pkl
https://github.com/apple/pkl-pantry

closes: vim/vim#19948

871e6c6cf9

Co-authored-by: Nihaal Sangha <nihaal.git@gmail.com>
2026-04-11 08:05:43 +08:00
zeertzjq
4f7b6083e5 vim-patch:9.2.0331: spellfile: stack buffer overflows in spell file generation (#38948)
Problem:  spell_read_aff() uses sprintf() into a fixed-size stack buffer
          without bounds checking. store_aff_word() uses STRCAT() to
          append attacker-controlled strings into newword[MAXWLEN] without
          checking remaining space. Both are reachable via :mkspell with
          crafted .aff/.dic files (xinyi234)
Solution: Replace sprintf() with vim_snprintf() in spell_read_aff().
          Replace STRCAT() with STRNCAT() with explicit remaining-space
          calculation in store_aff_word().

closes: vim/vim#19944

07faa961a0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-10 23:39:54 +00:00
zeertzjq
5ecff6c96f vim-patch:9.2.0330: tests: some patterns in tar and zip plugin tests not strict enough (#38947)
Problem:  Some patterns in tar and zip plugin tests not strict enough.
Solution: Use assert_equal() for lines that should match exactly. Match
          a literal dot properly (zeertzjq).

closes: vim/vim#19946

2fbc69c9ad
2026-04-11 07:26:35 +08:00
bfredl
eea1b99282 refactor(oldtest): one test_alot.vim file is already alot
neovim always uses encoding=utf8. Thus a lot of utf8 tests are just a
lot of tests. Meanwhile test_regexp_latin.vim is a bit of a lone child,
it can just run as a separate test without a shell layer (running it in
the same process as its utf8 sibling is not allowed
2026-04-10 13:21:20 +02:00
zeertzjq
ec8d352117 vim-patch:9.2.0326: runtime(tar): but with dotted path
Problem:  runtime(tar): but with dotted path
Solution: Do not strip everything after the first dot
          (Aaron Burrow)

tar#Extract was getting the extensionless basename by
stripping away everything starting with the leftmost
dot.  So if a directory had a dot or the file had an
'extra' dot then the code did the wrong thing.  For
example, if it was given:

  /tmp/foo.bar/baz.tar.gz

Then it would treat /tmp/foo as the extensionless
basename, but it actually should have grabbed:

  /tmp/foo.bar/baz

This patch fixes the issue by instead looking at the
rightmost dot(s).

This bug was discovered by ChatGPT 5.4.  I wrote the
patch and tested vim.

closes: vim/vim#19930

4a1bcc67b4

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-10 12:30:38 +08:00
zeertzjq
dc3b49d5a1 vim-patch:9.2.0325: runtime(tar): bug in zstd handling
Problem:  patch 9.2.0325: runtime(tar): bug in zstd handling
Solution: use correct --zstd argument, separated from other arguments,
          rework testing framework (Aaron Burrow).

The tar.vim plugin allows vim to read and manipulate zstd archives,
but it had a bug that caused extraction attempts to fail.
Specifically, if the archive has a .tar.zst or .tzst extension, then
the code was generating invalid extraction commands that looked like
this:

  tar --zstdpxf foo.tar.zst foo

When they should be like this:

  tar --zstd -pxf foo.tar.zst foo

This patch changes the flag manipulation logic so that --zstd isn't
glued to pxf.

The labor for this change was divided between ChatGPT 5.4 and me.
ChatGPT 5.4 identified the issue (from a code scan?), and I wrote
the patch and tested vim.

related: vim/vim#19930

00285c035a

Note: tests need the next patch to pass in Nvim.

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-10 12:30:31 +08:00
zeertzjq
10e385cf30 vim-patch:9.2.0329: tests: test_indent.vim leaves swapfiles behind (#38921)
Problem:  tests: test_indent.vim leaves swapfiles behind
Solution: Close open buffer using :bw! instead of :close!

158947e294

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-09 23:56:18 +00:00
zeertzjq
93b3ea26ac vim-patch:9.2.0327: filetype: uv scripts are not detected (#38920)
Problem:  filetype: uv scripts are not detected
          (Asger Hautop Drewsen)
Solution: Detect uv scripts as python filetype if the shebang line
          contains "uv run"

Reference:
https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file

fixes: vim/vim#19941

6c16ccaf61

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-10 07:28:24 +08:00
zeertzjq
cfbbec6fda vim-patch:9.2.0324: 0x9b byte not unescaped in <Cmd> mapping (#38919)
Problem:  0x9b byte not unescaped in <Cmd> mapping (BenYip).
Solution: Translate K_CSI to CSI like what is done in vgetc().
          (zeertzjq).

fixes:  vim/vim#19936
closes: vim/vim#19937

3e2012914e
2026-04-10 07:03:56 +08:00
zeertzjq
eefb50e352 vim-patch:9.2.0323: filetype: buf.lock files are not recognized (#38897)
Problem:  filetype: buf.lock files are not recognized
Solution: Detect buf.lock files as yaml filetype
          (Stefan VanBuren)

Reference:
https://buf.build/docs/configuration/v2/buf-lock/

closes: vim/vim#19935

c2734dc03c

Co-authored-by: Stefan VanBuren <svanburen@buf.build>
2026-04-08 23:11:20 +00:00
bfredl
0ce48e7a9c fix(oldtests): move useful settings from ignored unix.vim
the unix.vim file was probably accidentally ignored at some point.
An actual invokation of nvim-under-test would in practice look like

  ["/path/to/neovim/build/bin/nvim", "-u", "unix.vim", "-U", "NONE", "-i", "NONE", "--noplugin", "--headless", "-u", "NONE", "--cmd", "set shortmess-=F", "-S", "runtest.vim", "test_arabic.vim"]

but -u NONE cancels out the earlier -u unix.vim

By now, too many tests rely on specific behavior from "NONE", so copy in
the useful parts of unix.vim to the cmdline again. also, some tests
conflict with `directory=.` (or even `directory=Xtempswapdir`) so don't use that.

`-U NONE` is dead code in Nvim, remove it.
2026-04-08 13:12:14 +02:00
zeertzjq
056304ef5b vim-patch:9.2.0306: runtime(tar): some issues with lz4 support (#38826)
Problem:  runtime(tar): some issues with lz4 support
Solution: Fix bugs (see below) (Aaron Burrow)

The tar plugin allows users to extract files from tar archives that are
compressed with lz4. But, tar#Extract() builds malformed extraction commands
for lz4-compressed tar archives. This commit fixes three issues in that code.
The first affects archives with a .tlz4 extension and the other two affect
archives with .tar.lz4 extension (but one of these is symmetric to the issue
that .tlz4 archives had).

(1) When trying to extract .tlz4 archives the command created by
tar#Extract looked like this:

    tar -I lz4pxf foo.tlz4 foo

This isn't right.  It should be something like this:

    tar -I lz4 -pxf foo.tlz4 foo

This was happening because tar.plugin is just substituting on the
first - in "tar -pxf".  This works fine if we just add a simple flag for
extraction (eg, z for .tgz), but for lz4 we need to add "-I lz4".

I don't believe that there is an obvious good way to fix this without
reworking the way the command is generated.  Probably we should collect
the command and flags separately and the flags should be stored in a
set. Then put everything together into a string just before issuing it
as an extraction command.  Unfortunately, this might break things for users
because they have access to tar_extractcmd.

This patch just makes the substitution a little bit more clever so that it
does the right thing when substituting on a string like "tar -pxf".

(2) .tar.lz4 extractions had the same issue, which my patch fixes in
the same way.

(3) .tar.lz4 extractions had another issue.  There was a space missing
in the command generated by tar#Extract.  This meant that commands
looked like this (notice the lack of space between the archive and output
file names):

    tar -I lz4pxf foo.tar.lz4foo

This patch just puts a space where it should be.

Finally, I should note that ChatGPT 5.4 initially identified this issue
in the code and generated the test cases.  I reviewed the test cases,
wrote the patch, and actually ran vim against the tests (both with and
without the patch).

closes: vim/vim#19925

78954f86c2

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-06 13:43:28 +00:00
zeertzjq
f8695fc529 vim-patch:9.2.0304: tests: test for 9.2.0285 doesn't always fail without the fix
Problem:  When the terminal is very large, test for 9.2.0285 doesn't
          trigger an ASAN error without the fix.
Solution: Use a window with fixed height (zeertzjq)

closes: vim/vim#19924

b03970f41f
2026-04-06 16:28:06 +08:00
zeertzjq
c2d7f6b642 vim-patch:9.2.0303: tests: zip plugin tests don't check for warning message properly
Problem:  zip plugin tests may match messages from previous test cases
          when checking for warning message.
Solution: Clear messages at the start of these tests (zeertzjq).

closes: vim/vim#19926

a1f4259e68
2026-04-06 16:28:03 +08:00
zeertzjq
870e50f0ff vim-patch:9.2.0293: :packadd may lead to heap-buffer-overflow
Problem:  :packadd may lead to heap-buffer-overflow when all entries in
          'runtimepath' have the same length (after 9.2.0291).
Solution: Check for comma after current entry properly (zeertzjq).

related: vim/vim#19854
closes:  vim/vim#19911

bc182ae56e
2026-04-06 11:47:44 +08:00
zeertzjq
4aa8969d29 vim-patch:9.2.0299: runtime(zip): may write using absolute paths (#38810)
Problem:  runtime(zip): may write using absolute paths
          (syndicate)
Solution: Detect this case and abort on Unix, warn in the documentation
          about possible issues

46f530e517

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-06 10:15:19 +08:00
zeertzjq
d10dda8a47 vim-patch:9.2.0295: 'showcmd' shows wrong Visual block size with 'linebreak' (#38756)
Problem:  'showcmd' shows wrong Visual block size with 'linebreak' after
          end char (after 7.4.467).
Solution: Exclude 'linebreak' from end position. Also fix confusing test
          function names.

closes: vim/vim#19908

08bd9114c1
2026-04-04 20:49:26 +08:00
zeertzjq
164dfa1d5f vim-patch:9.2.0289: 'linebreak' may lead to wrong Visual block highlighting (#38749)
Problem:  'linebreak' may lead to wrong Visual block highlighting when
          end char occupies multiple cells (after 7.4.467).
Solution: Exclude 'linebreak' from the ending column instead of setting
          'virtualedit' temporarily (zeertzjq).

fixes:  vim/vim#19898
closes: vim/vim#19900

23be1889d1
2026-04-04 08:58:17 +08:00
zeertzjq
333e3178ec vim-patch:9.2.0287: filetype: not all ObjectScript routines are recognized (#38731)
Problem:  filetype: not all ObjectScript routines are recognized
Solution: Also detect "%RO" and "iris" patterns inside *.rtn files
          (Hannah Kimura)

closes: vim/vim#19873

863e85e00a

Co-authored-by: Hannah <hannah.kimura@intersystems.com>
2026-04-03 18:26:04 +08:00
zeertzjq
d7ef77d175 vim-patch:9.2.0285: :syn sync grouphere may go beyond end of line (#38727)
Problem:  :syn sync grouphere may go beyond end of line.
Solution: Start searching for the end of region at the end of match
          instead of a possibly invalid position (zeertzjq).

closes: vim/vim#19896

b7cffc8434
2026-04-03 09:22:26 +00:00
zeertzjq
0851ac2706 vim-patch:9.2.0280: [security]: path traversal issue in zip.vim (#38693)
Problem:  [security]: path traversal issue in zip.vim
          (Michał Majchrowicz)
Solution: Detect more such attacks and warn the user.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-jc86-w7vm-8p24

7088926316

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 22:23:23 +00:00
zeertzjq
65e2218585 vim-patch:9.2.0277: tests: test_modeline.vim fails (#38672)
Problem:  tests: test_modeline.vim fails (after v9.2.0276)
Solution: Rewrite the tests to use the existing s:modeline_fails()
          function, update documentation (zeertzjq).

8c8772c6b3
2026-04-01 08:43:03 +00:00
zeertzjq
c7604323e3 vim-patch:9.2.0276: [security]: modeline security bypass (#38657)
Problem:  [security]: modeline security bypass
Solution: disallow mapset() from secure mode, set the P_MLE flag for the
          'complete', 'guitabtooltip' and 'printheader' options.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-8h6p-m6gr-mpw9

75661a66a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 08:00:33 +08:00
zeertzjq
a89d7dcb91 docs: misc (#38578) 2026-04-01 07:59:51 +08:00
zeertzjq
19fff0e0be vim-patch:9.2.0232: fileinfo not shown after :bd of last listed buffer (#38453)
Problem:  fileinfo not shown after :bd of last listed buffer
          (memeplex)
Solution: Set need_fileinfo to true in empty_curbuf()
          (Hirohito Higashi)

When deleting the last listed buffer with :bd, the new empty buffer's
file info (e.g. "[No Name]" --No lines in buffer--) was not displayed.
do_ecmd() only calls fileinfo() for existing buffers (oldbuf), not for
newly created empty buffers.

Set need_fileinfo in empty_curbuf() so the file info is displayed after
redraw.

fixes:  vim/vim#548
closes: vim/vim#19802

3d472d8675

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:13:54 +08:00
Sean Dewar
8579946eda vim-patch:9.2.0254: w_locked can be bypassed when setting recursively
Problem:  w_locked can be bypassed when recursively set if not restored
          to its prior value.
Solution: Rather than save/restore everywhere, just make it a count,
          like other locks (Sean Dewar)

Requires the previous commit, otherwise b_nwindows will be wrong in
tests, which causes a bunch of weird failures.

closes: vim/vim#19728

7cb43f286e

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-03-29 23:49:24 +01:00
Sean Dewar
6617f85b76 vim-patch:9.2.0253: various issues with wrong b_nwindows after closing buffers
Problem:  close_buffer() callers incorrectly handle b_nwindows,
          especially after nasty autocmds, allowing it to go
          out-of-sync.  May lead to buffers that can't be unloaded, or
          buffers that are prematurely freed whilst displayed.
Solution: Modify close_buffer() and review its callers; let them
          decrement b_nwindows if it didn't unload the buffer.  Remove
          some now unneeded workarounds like 8.2.2354, 9.1.0143,
          9.1.0764, which didn't always work (Sean Dewar)

(endless yapping omitted)

related: vim/vim#19728

bf21df1c7b

b_nwindows = 0 change for free_all_mem() was already ported.

Originally Nvim returned true when b_nwindows was decremented before the end was
reached (to better indicate the decrement). That's not needed anymore, so just
return true only at the end, like Vim. (retval isn't used anywhere now anyways)

Set textlock for dict watchers at the end of close_buffer() to prevent them from
switching windows, as that can leave a window with a NULL buffer. (possible
before this PR, but the new assert catches it; added a test)

Despite textlock, things still aren't ideal, as watchers may observe the buffer
as unloaded and hidden (b_nwindows was decremented), yet still in a window...
Likewise, for Nvim, wipe_qf_buffer()'s comment may not be entirely accurate;
autocmds are blocked, but on_detach callbacks (textlocked) and dict watchers may
still run. Might be problematic, but those aren't new issues.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-03-29 23:49:24 +01:00
Sean Dewar
d539d6ac6e vim-patch:9.2.0252: Crash when ending Visual mode after curbuf was unloaded
Problem:  if close_buffer() in set_curbuf() unloads curbuf, NULL pointer
          accesses may occur from enter_buffer() calling
          end_visual_mode(), as curbuf is already abandoned and possibly
          unloaded.  Also, selection registers may not contain the
          selection with clipboard+=autoselect(plus).
Solution: Move close_buffer()'s end_visual_mode() call to buf_freeall(), after
          any autocmds that may restart it, but just before freeing anything
          (Sean Dewar)

related: vim/vim#19728

a8fdfd4fcb

Maybe this should be considered partial? clipboard+=autoselect isn't
implemented. If it is, we may need to update these comments to mention
TextYankPost being possible, and unskip its test.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-03-29 23:49:24 +01:00
zeertzjq
ba89354a45 vim-patch:9.2.0270: test: trailing spaces used in tests
Problem:  test: trailing spaces used in tests
Solution: Rewrite tests to avoid trailing spaces (Paul Ollis).

Some tests currently rely on trailing whitespace at the end of lines,
escaped with '\'. I have demonstrated in another PR, such spaces can be
inadvertently removed and this is difficult to spot.

Note: there are more trailing spaces in a few more test files, see
testdir/test_codestyle.vim. Those are not yet removed.

closes: vim/vim#19838

211ceea602

Co-authored-by: Paul Ollis <paul@cleversheep.org>
2026-03-29 22:30:41 +08:00
zeertzjq
a89b9750ee vim-patch:9.2.0050: WM_SETFOCUS not handled immediately
Problem:  In gvim on Windows, a certain problem can occur when the
          WM_SETFOCUS event sent after an external command is not
          processed immediately.
Solution: After posting WM_SETFOCUS, run the message loop to process it
          as quickly as possible (Muraoka Taro).

The problem is that Test_normal11_showcmd may fail when running the
test_normal.vim test.  Investigation revealed that the trigger was an
external command executed in the previous test,
Test_mouse_shape_after_failed_change, when two tests were executed
consecutively.  In gvim on Windows, a WM_SETFOCUS event will be sent
when an external command finishes executing.  This WM_SETFOCUS event is
not processed immediately, but rather by redraw, which is expected to
update showcmd. Because it is queued in typebuf at this time,
clear_showcmd(), which expects typebuf to be empty, cannot update
showcmd.

Also added a test that simulates the above problem.

closes: vim/vim#19167

c4a6fa3ead

Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
2026-03-29 22:30:24 +08:00
Justin M. Keyes
9c55674ba9 test(oldtest): skip 2 tests on s390x
Failures:
    From test_plugin_tar.vim:
    Found errors in Test_tar_evil():
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_tar_evil line 12: Pattern '/etc/ax-pwn' does not match '/usr/bin/tar: Removing leading `/'' from member names'
    Caught exception in Test_tar_evil(): Vim(read):E484: Can't open file usr/bin/tar: Removing leading `/' from member names @ command line..script …/test/old/testdir/runtest.vim[659]..function
    RunTheTest[61]..Test_tar_evil[22]..<SNR>10_TarBrowseSelect[27]..tar#Read, line 114
    Found errors in Test_tar_path_traversal_with_nowrapscan():
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_tar_path_traversal_with_nowrapscan[1]..<SNR>8_CopyFile line 2: Can't copy samples/evil.tar
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_tar_path_traversal_with_nowrapscan line 14: Pattern '/etc/ax-pwn' does not match '/usr/bin/tar: Removing leading `/'' from
    member names'
    From test_search_stat.vim:
    Found errors in Test_search_stat_option():
    Run 1, 00:17:24 - 00:17:26 in  2.405525 seconds:
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 31: Pattern 'fo\\*\\\\(bar\\\\?\\\\)\\\\?\\s\\+\\[2/>999\\]' does not match '\n/fo*\\(bar\\?\\)\\?\[
    occurs 63 times]\n\n/fo*\\(bar\\?\\)\\?\[  occurs 57 times][?/??]'
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 32: Expected {'incomplete': 2, 'total': 1000} but got {'incomplete': 1, 'total': 980} - 3 equal items
    omitted
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 52: Expected {'exact_match': 1, 'current': 27992, 'incomplete': 0, 'total': 28000} but got
    {'exact_match': 0, 'current': 18044, 'incomplete': 1, 'total': 18044} - 1 equal item omitted
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 55: Expected {'incomplete': 0, 'total': 28000} but got {'incomplete': 1, 'total': 18143} - 3 equal
    items omitted
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 65: Expected {'total': 28000, 'incomplete': 0} but got {'total': 18168, 'incomplete': 1} - 3 equal
    items omitted
    command line..script …/test/old/testdir/runtest.vim[659]..function RunTheTest[61]..Test_search_stat_option line 68: Expected {'exact_match': 1, 'current': 27991, 'total': 28000, 'incomplete': 0} but got
    {'exact_match': 0, 'current': 18167, 'total': 18167, 'incomplete': 1} - 1 equal item omitted
    Run 2, 00:17:28 - 00:17:32 in  3.437275 seconds:
    command line..script …/test/old/testdir/runtest.vim[700]..function RunTheTest[61]..Test_search_stat_option line 31: Pattern 'fo\\*\\\\(bar\\\\?\\\\)\\\\?\\s\\+\\[2/>999\\]' does not match '\n/fo*\\(bar\\?\\)\\?\[
    occurs 63 times]\n\n/fo*\\(bar\\?\\)\\?\[  occurs 57 times][?/??]'
    command line..script …/test/old/testdir/runtest.vim[700]..function RunTheTest[61]..Test_search_stat_option line 32: Expected {'incomplete': 2, 'total': 1000} but got {'incomplete': 1, 'total': 991} - 3 equal items
    omitted
    Run 3, 00:17:36 - 00:17:39 in  3.408885 seconds:
    command line..script …/test/old/testdir/runtest.vim[700]..function RunTheTest[61]..Test_search_stat_option line 31: Pattern 'fo\\*\\\\(bar\\\\?\\\\)\\\\?\\s\\+\\[2/>999\\]' does not match '\n/fo*\\(bar\\?\\)\\?\[
    occurs 63 times]\n\n/fo*\\(bar\\?\\)\\?\[  occurs 57 times][?/??]'
    command line..script …/test/old/testdir/runtest.vim[700]..function RunTheTest[61]..Test_search_stat_option line 32: Expected {'incomplete': 2, 'total': 1000} but got {'incomplete': 1, 'total': 994} - 3 equal items
    omitted
    Flaky test failed too often, giving up
2026-03-29 13:36:56 +02:00
zeertzjq
5a7df03b42 vim-patch:9.2.0265: unnecessary restrictions for defining dictionary function names (#38524)
Problem:  unnecessary restrictions for defining dictionary function
          names
Solution: Allow defining dict function with bracket key that is not a
          valid identifier (thinca)

In Vim script, "function obj.func()" and "function obj['func']()" both
define a dictionary function.  However, the bracket form required the
key to match function naming rules (eval_isnamec), so
"function obj['foo-bar']()" failed with E475.

Assigning and calling already work: "let obj['foo-bar'] = obj.func"
and "call obj['foo-bar']()" are valid.  Only the definition was
incorrectly restricted.

Skip the identifier check when the name comes from fd_newkey (i.e. the
key was given in bracket notation).  Dictionary keys may be any string.

Supported by AI

closes: vim/vim#19833

f89662722d

Co-authored-by: thinca <thinca@gmail.com>
2026-03-28 18:51:00 +08:00
zeertzjq
6dfcb2b784 vim-patch:9.2.0237: filetype: ObjectScript routines are not recognized (#38479)
Problem:  filetype: ObjectScript routines are not recognized
Solution: Add ObjectScript routines detection for .mac, .int, and .inc
          files (Hannah Kimura)

Reference:
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_ch_intro#GORIENT_intro_routines

closes: vim/vim#19805

25f6539645

Co-authored-by: Hannah Kimura <hannah.kimura@intersystems.com>
2026-03-25 01:02:04 +00:00
zeertzjq
f806c77391 vim-patch:9.2.0239: signcolumn may cause flicker (#38477)
Problem:  Changing the 'signcolumn' may cause flicker, because it uses
          the P_RCLR flag for redrawing (Yggdroot)
Solution: Change 'signcolumn' to use P_RWIN instead of P_RCLR, matching
          the behavior of 'number' and 'foldcolumn'
          (Yasuhiro Matsumoto).

fixes:  vim/vim#19663
closes: vim/vim#19713

4292eea714

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-03-25 08:19:42 +08:00
Anakin Childerhose
1de1c08210 vim-patch:9.2.0235: filetype: wks files are not recognized (#38451)
Problem:  filetype: wks files are not recognized.
Solution: Detect *.wks, *.wks.in and *.wks.inc as wks filetype,
          include a filetype and syntax plugin (Anakin Childerhose)

The OpenEmbedded Image Creation tool, `wic` uses wic kickstarter files
to define image partition and bootloader layouts.
wks files can end with .wks, .wks.in for templated wks files, and
.wks.inc for including in other .wks files.

The autocmd for *.wks.inc needs to come before *.inc in
runtime/ftdetect.vim

Reference:
https://docs.yoctoproject.org/ref-manual/kickstart.html#openembedded-kickstart-wks-reference
https://git.openembedded.org/openembedded-core/tree/scripts/lib/wic/canned-wks

closes: vim/vim#19796

8c116bbe79
2026-03-23 23:40:03 +00:00
zeertzjq
e51f217be7 vim-patch:9.2.0223: Option handling for key:value suboptions is limited (#38426)
Problem:  Option handling for key:value suboptions is limited
Solution: Improve :set+=, :set-= and :set^= for options that use
          "key:value" pairs (Hirohito Higashi)

For comma-separated options with P_COLON (e.g., diffopt, listchars,
fillchars), :set += -= ^= now processes each comma-separated item
individually instead of treating the whole value as a single string.

For :set += and :set ^=:
- A "key:value" item where the key already exists with a different value:
  the old item is replaced.
- An exact duplicate item is left unchanged.
- A new item is appended (+=) or prepended (^=).

For :set -=:
- A "key:value" or "key:" item removes by key match regardless of value.
- A non-colon item removes by exact match.

This also handles multiple non-colon items (e.g., :set
diffopt-=filler,internal) by processing each item individually, making
the behavior order-independent.

Previously, :set += simply appended the value, causing duplicate keys to
accumulate.

fixes:  vim/vim#18495
closes: vim/vim#19783

e2f4e18437

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:13:48 +08:00