From: Yasuhiro Matsumoto Date: Fri, 1 May 2026 13:25:31 +0000 (+0000) Subject: patch 9.2.0423: popup: wrapped cmdline truncated with wildoptions=pum X-Git-Tag: v9.2.0423^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=587447ec64ffd9e6eaba329ffd9d778159ea6e32;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/ex_getln.c b/src/ex_getln.c index 1124f45865..e5a9ce776f 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 0000000000..409cf54fa4 --- /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 ee5f668bb2..e793292ff7 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 =wildtrigger()[-1] + [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\") + endfor + + call WaitForTermCurPosAndLinesToMatch(buf, [rows, ((3 + 40) - cols + 1)]) + call VerifyScreenDump(buf, 'Test_wildtrigger_wrapped_cmdline_1', {}) + + call term_sendkeys(buf, "\") + 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 9a28bf20e1..dca5176357 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, /**/