patch 9.2.0423: popup: wrapped cmdline truncated with wildoptions=pum
Commit:
https://github.com/vim/vim/commit/587447ec64ffd9e6eaba329ffd9d778159ea6e32
Author: Yasuhiro Matsumoto <
matt...@gmail.com>
Date: Fri May 1 13:25:31 2026 +0000
patch 9.2.0423: popup: wrapped cmdline truncated with wildoptions=pum
Problem: popup: wrapped cmdline truncated with wildoptions=pum
Solution: Call msg_starthere() in redrawcmd() to reset lines_left
before each redraw (Yasuhiro Matsumoto).
redrawcmd() leaves lines_left at its previous value, which decrements
across successive redraws (e.g. when wildtrigger() refreshes the popup
on every keystroke) until 0, after which msg_no_more aborts drawing
the wrapped cmdline. Call msg_starthere() to reset it.
related: #20081
Signed-off-by: Yasuhiro Matsumoto <
matt...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 1124f4586..e5a9ce776 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4122,6 +4122,8 @@ redrawcmd(void)
sb_text_restart_cmdline();
msg_start();
+ // Reset lines_left so a wrapped cmdline isn't truncated by msg_no_more.
+ msg_starthere();
redrawcmdprompt();
// Don't use more prompt, truncate the cmdline if it doesn't fit.
diff --git a/src/testdir/dumps/Test_wildtrigger_wrapped_cmdline_1.dump b/src/testdir/dumps/Test_wildtrigger_wrapped_cmdline_1.dump
new file mode 100644
index 000000000..409cf54fa
--- /dev/null
+++ b/src/testdir/dumps/Test_wildtrigger_wrapped_cmdline_1.dump
@@ -0,0 +1,8 @@
+|~+0#4040ff13#ffffff0| @28
+|~| @28
+|~| @28
+|~| @28
+|~| @28
+|~| @28
+|:+0#0000000&|e| |x@26
+@13> @16
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index ee5f668bb..e793292ff 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -5249,6 +5249,32 @@ func Test_wildtrigger_update_screen()
call StopVimInTerminal(buf)
endfunc
+" Wrapped cmdline must not be truncated when wildtrigger() redraws on every
+" keystroke.
+func Test_wildtrigger_wrapped_cmdline()
+ CheckScreendump
+
+ let lines =<< trim [SCRIPT]
+ set wildmenu wildmode=noselect:lastused,full wildoptions=pum
+ cnoremap <F8> <C-R>=wildtrigger()[-1]<CR>
+ [SCRIPT]
+ call writefile(lines, 'XTest_wildtrigger_wrap', 'D')
+ let rows = 8
+ let cols = 30
+ let buf = RunVimInTerminal('-S XTest_wildtrigger_wrap', {'rows': rows, 'cols': cols})
+
+ call term_sendkeys(buf, ":e ")
+ for i in range(40)
+ call term_sendkeys(buf, "x\<F8>")
+ endfor
+
+ call WaitForTermCurPosAndLinesToMatch(buf, [rows, ((3 + 40) - cols + 1)])
+ call VerifyScreenDump(buf, 'Test_wildtrigger_wrapped_cmdline_1', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
" Issue #17969: With 'noselect', the popup menu should appear next to the
" environment variable being expanded. Disable 'showtail' when completing
" file paths when 'noselect' is present.
diff --git a/src/version.c b/src/version.c
index 9a28bf20e..dca517635 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 423,
/**/
422,
/**/