Commit Graph

2068 Commits

Author SHA1 Message Date
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
Justin M. Keyes
55ceb314ca feat(ui): use vim.ui.select for :tselect, z= #39478
Problem:
`:tselect` and `z=` (spell suggest) have their own bespoke select menus.

Solution:
- Delegate to `vim.ui.select` instead.
- Bonus:
  - `:tselect` gains mouse support. `print_tag_list` didn't suport mouseclick.

This causes some minor regressions, which are not blockers:

- `z=` no longer draws the list right-left if 'rightleft' is set.
  - TODO: can/should `vim.ui.select` / `vim.fn.inputlist()` handle that?
- `:tselect`
  - No "column" headings (`# pri kind tag file`).
  - No highlighting: (HLF_T: tag name, HLF_D: file, HLF_CM: extra fields).
  - TODO: can `vim.ui.select()` support highlighted chunks (`[[text, hl_id], ...]`) ?

fix https://github.com/neovim/neovim/issues/25814
fix https://github.com/neovim/neovim/issues/31987
2026-04-28 18:29:17 -04:00
zeertzjq
72bc6c5801 vim-patch:9.2.0405: when jumping to tags, will open URLs (#39461)
Problem:  when jumping to tags, will open URLs
          (Srinivas Piskala Ganesh Babu)
Solution: Disallow trying to open remote files.

closes: vim/vim#20068

Supported by AI

ae196b2d58

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-28 08:07:57 +08:00
Barrett Ruth
0a7201095b vim-patch:9.2.0400: sandbox callbacks selected through 'complete' (#39452)
Problem:  Modeline-tainted 'complete' values can invoke completion
          callbacks outside the sandbox.
Solution: Enter the sandbox for both 'complete' callback phases and add
          a regression test (Barrett Ruth)

closes: vim/vim#20078

dd9b31fb62
2026-04-27 23:09:33 +00:00
Jan Edmund Lazo
689c824ef7 vim-patch:8.2.2128: there is no way to do something on CTRL-Z (#39440)
Problem:    There is no way to do something on CTRL-Z.
Solution:   Add VimSuspend and VimResume autocommand events. (closes vim/vim#7450)

100118c73a

----

Nvim implemented these events first and has enough tests.
test_suspend.vim relies on Vim 'terminal' feature.
Treat it as N/A even if all tests could be ported as Lua functional
screen/terminal tests.

----

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-27 03:57:01 +00:00
zeertzjq
0039a13fe4 vim-patch:9.2.0395: tests: Test_backupskip() may read from $HOME (#39417)
Problem:  tests: Test_backupskip() may read from $HOME
Solution: Set $HOME to an empty value, use --clean
          (D Ben Knoble)

Even though we unset HOME, we can see via scriptnames that user files
are still sourced! One of my installed plugins warns when not compiled
with +python3, so this test has a "press Enter" prompt.

Use `--clean` like most other GetVimProg()'s do to fix it. Some tests
use `system()` instead, but that turns this test into a failure rather
than passing; I'm not sure why other tests don't suffer from this.

To prove to ourselves, we can use code like this:

    diff --git i/src/testdir/test_options.vim w/src/testdir/test_options.vim
    index a408e20e1..044364a54 100644
    --- i/src/testdir/test_options.vim
    +++ w/src/testdir/test_options.vim
    @@ -1179,6 +1179,7 @@ func Test_backupskip()
       " P_NODUP).  Run this in a separate instance and write v:errors in a file,
       " so that we see what happens on startup.
       let after =<< trim [CODE]
    +      call writefile([execute('scriptnames')], 'foo')
           let bsklist = split(&backupskip, ',')
           call assert_equal(uniq(copy(bsklist)), bsklist)
           call writefile(['errors:'] + v:errors, 'Xtestout')
    @@ -1196,7 +1197,7 @@ func Test_backupskip()
       " unset $HOME, so that it won't try to read init files
       let saveenv['HOME'] = getenv("HOME")
       call setenv('HOME', v:null)
    -  exe 'silent !' . cmd
    +  exe 'silent !' . cmd .. ' --cmd "echo &rtp"'
       call assert_equal(['errors:'], readfile('Xtestout'))

       " restore environment variables

Here, that causes "foo" to include a bunch of files under ~/.vim. I'm
not sure why this happens, but lets paper over it for the test.

We can also tell that (orthogonal to --clean) setting HOME='' works too.
Let's do that in addition since unsetting HOME isn't quite enough.

closes: vim/vim#20051

8d9c383aaf

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2026-04-26 16:59:32 +08:00
zeertzjq
cdd5009824 vim-patch:8.2.1498: on slow systems tests can be flaky (#39413)
Problem:    On slow systems tests can be flaky.
Solution:   Use TermWait() instead of term-wait(). (Yegappan Lakshmanan,
            closes vim/vim#6756)

733d259a83

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-25 23:03:40 +00:00
Jan Edmund Lazo
f8f95ee412 build(vim-patch): update N/A test files (#39405)
* build(vim-patch): test_clientserver.vim is N/A

Requires 'job' and 'clientserver' features.
Both N/A for Neovim.

* build(vim-patch): test_gui_init.vim is N/A

Starts with command 'CheckCanRuiGui' .
Nvim doesn't support ':gui' (yet).

* build(vim-patch): test_plugin_vimball.vim is N/A

Run ':h vimball'.

* build(vim-patch): test_remote.vim is N/A

Needs 'clientserver', 'terminal' features.

* build(vim-patch): test_short_sleep.py is for test_terminal.vim. Both N/A

* build(vim-patch): mark N/A files from test_crypt.vim

* build(vim-patch): mark N/A file for test_terminal3.vim

* build(vim-patch): mark N/A files channel/terminal/vim9 tests
2026-04-26 06:31:19 +08:00
tao
f130922744 fix(path): normalize path slashes on Windows #37729
Problem:
On Windows, path separators may become inconsistent for various reasons,
which makes normalization quite painful.

Solution:
Normalize paths to `/` at the entry boundaries and always use it
internally, converting back only in rare cases where `\` is really
needed (e.g. cmd.exe/bat scripts?).

This is the first commit in a series of incremental steps.

Note:
* some funcs won't respect shellslash. e.g. `expand/fnamemodify`
* some funcs still respect shellslash, but will be updated in a follow
  PR. e.g. `ex_pwd/f_chdir/f_getcwd`
* uv's built-in funcs always return `\`. e.g. `uv.cwd/uv.exepath`

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-04-24 13:20:25 -04:00
zeertzjq
c0e358f7e8 vim-patch:9.2.0390: filetype: some Beancount files are not recognized (#39360)
Problem:  filetype: some Beancount files are not recognized
Solution: Detect *.bean files as beancount filetype
          (Bruno Belanyi)

closes: vim/vim#20037

521eac1877

Co-authored-by: Bruno Belanyi <bruno@belanyi.fr>
2026-04-24 07:50:31 +08:00
zeertzjq
313e0f9281 vim-patch:9.2.0383: [security]: runtime(netrw): shell-injection via sftp: and file: URLs
Problem:  runtime(netrw): shell-injection via sftp: and file: URLs
          (Joshua Rogers)
Solution: Escape temporary file names, harden filename suffix regex,
          drop unused g:netrw_tmpfile_escape variable

Supported by AI

405e2fb6d5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-23 12:51:11 +08:00
zeertzjq
d6cdd04223 vim-patch:9.2.0367: runtime(netrw): ~ note expanded on MS Windows
Problem:  runtime(netrw): ~ note expanded on MS Windows
          (Tom Vamvanij)
Solution: Expand ~ on MS Windows (Yasuhiro Matsumoto)

On Windows, ":Explore ~" did nothing because the tilde expansion was
gated to Unix/Cygwin only.  Additionally, substitute() interprets
backslashes in the replacement string specially (e.g. \U as a case
modifier), which would corrupt $HOME values like C:\Users\name even
if the branch were taken.

Include has("win32") in the guard, anchor the pattern to the start of
the string, and escape backslashes, ampersands and tildes in $HOME
before substituting.

fixes:  vim/vim#20003
closes: vim/vim#20014

723c0acf25

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-04-23 12:51:11 +08:00
zeertzjq
b33dc7fe45 vim-patch:9.2.0302: runtime(netrw): RFC2396 decoding double escaping spaces
Problem:  runtime(netrw): RFC2396 decoding double escaping spaces
          (lilydjwg, after 3e60f03d942d6bb0f7eac)
Solution: Remove escape() call, since we are using fnameescape() anyhow

fixes: vim/vim#19913

ab4ebb62ee

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-23 12:51:11 +08:00
zeertzjq
06a47ac994 vim-patch:9.2.0281: tests: Test_netrw_FileUrlEdit.. fails on Windows
Problem:  tests: Test_netrw_FileUrlEdit.. fails on Windows
          (after 3e60f03d942d6bb0f7)
Solution: Skip the test on Windows (Yasuhiro Matsumoto).

The Test_netrw_FileUrlEdit_pipe_injection() test fails on Windows with
E303 because '|' is not a valid filename character on Windows.  Since
the pipe character cannot appear in a Windows filename, the command
injection vector this test guards against does not apply on Windows.

closes: vim/vim#19890

c91081d0e5

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-04-23 12:51:11 +08:00
zeertzjq
0b7f2ac405 vim-patch:3e60f03: runtime(netrw): use fnameescape() with FileUrlEdit()
3e60f03d94

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-23 12:51:11 +08:00
zeertzjq
1cdaa7da10 vim-patch:9.2.0089: netrw: does not take port into account in hostname validation
Problem:  netrw: does not take port into account in hostname validation
          (after v9.2.0073)
Solution: Update hostname validation check and test for an optional port
          number (Miguel Barro)

closes: vim/vim#19533

a6198523fb

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2026-04-23 12:51:11 +08:00
zeertzjq
ab41543f8e vim-patch:9.2.0073: [security]: possible command injection using netrw
Problem:  [security]: Insufficient validation of hostname and port in
          netrw URIs allows command injection via shell metacharacters
          (ehdgks0627, un3xploitable).
Solution: Implement stricter RFC1123 hostname and IP validation.
          Use shellescape() for the provided hostname and port.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-m3xh-9434-g336

79348dbbc0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-23 12:51:11 +08:00
zeertzjq
84cafb9c97 vim-patch:9.2.0037: netrw: need better tests for absolute paths
Problem:  netrw: need better tests for absolute paths
Solution: Use absolutepath(), instead of regex test (Miguel Barro).

closes: vim/vim#19477

bd1dc5b1a6

Cherry-pick a typo fix from latest Vim.

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2026-04-23 12:51:11 +08:00
zeertzjq
ed12d56163 vim-patch:a2d87ba: runtime(netrw): Use right file system commands initialization for Windows
closes: vim/vim#19287
fixes:  vim/vim#12290

a2d87ba615

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2026-04-23 12:51:11 +08:00
zeertzjq
8f1e14ffa2 vim-patch:9.2.0356: Cannot apply 'scrolloff' context lines at end of file
Problem:  Cannot apply 'scrolloff' context lines at end of file
Solution: Add the 'scrolloffpad' option to keep 'scrolloff' context even
          when at the end of the file (McAuley Penney).

closes: vim/vim#19040

a414630393

Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
2026-04-22 10:14:52 +08:00
zeertzjq
1569a71c8a vim-patch:9.2.0385: Integer overflow with "ze" and large 'sidescrolloff' (#39289)
Problem:  Integer overflow with "ze" and large 'sidescrolloff'.
Solution: Check for overflow to avoid negative w_leftcol (zeertzjq).

closes: vim/vim#20026

33f3965087
2026-04-22 01:49:06 +00:00
zeertzjq
2445fab6fb vim-patch:9.2.0384: stale Insstart after cursor move breaks undo (#39290)
vim-patch:9.2.0384: stale Insstart after <Cmd> cursor move breaks undo

Problem:  A <Cmd> command executed from Insert mode can sync undo and
          move the cursor before the next edit. stop_arrow() saved the
          new cursor line for undo, but left Insstart at the previous
          insertion point. A line-start backspace could then delete
          lines above the saved line without saving the joined range,
          leaving a pending undo entry whose bottom resolved above
          its top and raising E340.
Solution: Update Insstart and Insstart_textlen after the pending undo
          save so the next edit starts from the command-updated cursor
          position (Jaehwang Jung).

closes: vim/vim#20031

AI-assisted: Codex

d4fb31762e

Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2026-04-22 01:35:47 +00:00
Barrett Ruth
8efe4f9ac1 fix(incsearch): support c_CTRL-{G,T} with an offset (#39097)
vim-patch:9.2.0374: c_CTRL-{G,T} does not handle offset

Problem:  c_CTRL-{G,T} does not handle offset, when cycling between
          matches
Solution: Refactor parsing logic into parse_search_pattern_offset() and
          handle offsets, note: highlighting does not handle offsets
          yet (Barrett Ruth).

fixes:  vim/vim#19991
closes: vim/vim#19998

c62342e5cf
2026-04-22 01:24:49 +00:00
luukvbaal
ff68fd6b8a fix(messages): "progress" kind for busy messages #39280
Problem:  The "Scanning:" completion, bufwrite, and indent (there may be
          more) messages which indicate progress can use the "progress" kind
          for their msg_show event. Indent message does not have a kind.

Solution: Emit these messages with the "progress" kind. Set the message id
          to the replaced kind so that a UI knows to replace it (and to provide
          a migration path in case a UI was distinguishing these messages for
          whatever reason).
2026-04-21 16:11:41 -04:00
zeertzjq
32e249dfa6 vim-patch:9.2.0371: filetype: ghostty config files are not recognized (#39267)
Problem:  filetype: ghostty config files are not recognized
Solution: Detect ghostty configuration files as ghostty filetype,
          include a simple ghostty filetype plugin (Bez Hermoso)

closes: vim/vim#20002

b30803b231

Co-authored-by: Bez Hermoso <bezalelhermoso@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-21 02:24:07 +00:00
zeertzjq
49d63ca548 vim-patch:9.2.0373: Ctrl-R mapping not triggered during completion (#39261)
Problem:  Ctrl-R mapping not triggered during completion.
Solution: Move Ctrl-R check out of vim_is_ctrl_x_key()
          (zeertzjq).

fixes:  vim/vim#20004
closes: vim/vim#20006

49e8630a28
2026-04-21 08:27:26 +08:00
zeertzjq
2ee25ba41b vim-patch:9.2.0364: tests: test_smoothscroll_textoff_showbreak() fails
Problem:  tests: test_smoothscroll_textoff_showbreak() fails
          (after v9.2.0363)
Solution: Add missing CheckRunVimInTerminal

related: vim/vim#20011

618a327ce6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-20 09:31:31 +08:00
Jaehwang Jung
79a7a4abe1 fix(smoothscroll): crash when resizing to textoff with showbreak
vim-patch:9.2.0362: division by zero with smoothscroll and small windows

Problem:  Resizing a smoothscrolled wrapped window to its textoff width
          with 'showbreak' can leave wrapped continuation lines with
          zero text width. win_lbr_chartabsize() still runs the partial max_head_vcol calculation in
          that state and divides by width2, crashing during redraw.
Solution: Skip that partial head calculation when the wrapped
          continuation width is zero, matching the other width2 guards
          in charset.c (Jaehwang Jung)

closes: vim/vim#20012

AI-assisted: Codex

0e31fb024c
2026-04-20 09:30:30 +08:00
Jan Edmund Lazo
9ded2fb7c8 vim-patch:8.2.3024: execute() function test fails
Problem:    execute() function test fails.
Solution:   Adjust test for different error.

2fb1b89d72

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-18 22:20:01 -04:00