From: zeertzjq Date: Mon, 4 May 2026 19:53:10 +0000 (+0000) Subject: patch 9.2.0439: completion: info popup not removed in cmdline mode X-Git-Tag: v9.2.0439^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bfffcc29054faff2dbec2d765317ee09e9ef827;p=thirdparty%2Fvim.git patch 9.2.0439: completion: info popup not removed in cmdline mode 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: #20128 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/popupwin.c b/src/popupwin.c index fb6e17d058..f019943805 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -5894,6 +5894,10 @@ popup_hide_info(void) { popup_on_cmdline = wp->w_popup_flags & POPF_ON_CMDLINE; popup_hide(wp); + if (State & MODE_CMDLINE) + // Cmdline mode doesn't normally call update_screen(), so it's + // necessary to use pum_call_update_screen() here. + pum_call_update_screen(); } } diff --git a/src/testdir/dumps/Test_customlist_info_popup_1.dump b/src/testdir/dumps/Test_customlist_info_popup_1.dump new file mode 100644 index 0000000000..0bb1ddb7b1 --- /dev/null +++ b/src/testdir/dumps/Test_customlist_info_popup_1.dump @@ -0,0 +1,12 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @26|╔+0#0000001#e0e0e08|═@12|X| +0#4040ff13#ffffff0@31 +|~| @6| +0#0000001#e0e0e08|a|p@1|l|e| @1|f| |f|r|u|i|t| @4|║| |A| |r|e|d| |f|r|u|i|t| |║| +0#4040ff13#ffffff0@31 +|~| @6| +0#0000001#ffd7ff255|b|a|n|a|n|a| |f| |f|r|u|i|t| @4|╚+0&#e0e0e08|═@12|⇲| +0#4040ff13#ffffff0@31 +|~| @6| +0#0000001#ffd7ff255|c|a|r@1|o|t| |v| |v|e|g|e|t|a|b|l|e| | +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|p|l|a|i|n| @13| +0#4040ff13#ffffff0@46 +|:+0#0000000&|D|i|c|t|C|m|d| |a|p@1|l|e> @60 diff --git a/src/testdir/dumps/Test_customlist_info_popup_2.dump b/src/testdir/dumps/Test_customlist_info_popup_2.dump new file mode 100644 index 0000000000..3959110152 --- /dev/null +++ b/src/testdir/dumps/Test_customlist_info_popup_2.dump @@ -0,0 +1,12 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @6| +0#0000001#ffd7ff255|a|p@1|l|e| @1|f| |f|r|u|i|t| @4|╔+0&#e0e0e08|═@15|X| +0#4040ff13#ffffff0@28 +|~| @6| +0#0000001#e0e0e08|b|a|n|a|n|a| |f| |f|r|u|i|t| @4|║| |A| |y|e|l@1|o|w| |f|r|u|i|t| |║| +0#4040ff13#ffffff0@28 +|~| @6| +0#0000001#ffd7ff255|c|a|r@1|o|t| |v| |v|e|g|e|t|a|b|l|e| |╚+0&#e0e0e08|═@15|⇲| +0#4040ff13#ffffff0@28 +|~| @6| +0#0000001#ffd7ff255|p|l|a|i|n| @13| +0#4040ff13#ffffff0@46 +|:+0#0000000&|D|i|c|t|C|m|d| |b|a|n|a|n|a> @59 diff --git a/src/testdir/dumps/Test_customlist_info_popup_3.dump b/src/testdir/dumps/Test_customlist_info_popup_3.dump new file mode 100644 index 0000000000..f67d860c5d --- /dev/null +++ b/src/testdir/dumps/Test_customlist_info_popup_3.dump @@ -0,0 +1,12 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @6| +0#0000001#ffd7ff255|a|p@1|l|e| @1|f| |f|r|u|i|t| @4| +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|b|a|n|a|n|a| |f| |f|r|u|i|t| @4|╔+0&#e0e0e08|═@20|X| +0#4040ff13#ffffff0@23 +|~| @6| +0#0000001#e0e0e08|c|a|r@1|o|t| |v| |v|e|g|e|t|a|b|l|e| |║| |A|n| |o|r|a|n|g|e| |v|e|g|e|t|a|b|l|e| |║| +0#4040ff13#ffffff0@23 +|~| @6| +0#0000001#ffd7ff255|p|l|a|i|n| @13|╚+0&#e0e0e08|═@20|⇲| +0#4040ff13#ffffff0@23 +|:+0#0000000&|D|i|c|t|C|m|d| |c|a|r@1|o|t> @59 diff --git a/src/testdir/dumps/Test_customlist_info_popup_4.dump b/src/testdir/dumps/Test_customlist_info_popup_4.dump new file mode 100644 index 0000000000..0092776a94 --- /dev/null +++ b/src/testdir/dumps/Test_customlist_info_popup_4.dump @@ -0,0 +1,12 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @6| +0#0000001#ffd7ff255|a|p@1|l|e| @1|f| |f|r|u|i|t| @4| +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|b|a|n|a|n|a| |f| |f|r|u|i|t| @4| +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|c|a|r@1|o|t| |v| |v|e|g|e|t|a|b|l|e| | +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#e0e0e08|p|l|a|i|n| @13| +0#4040ff13#ffffff0@46 +|:+0#0000000&|D|i|c|t|C|m|d| |p|l|a|i|n> @60 diff --git a/src/testdir/dumps/Test_customlist_info_popup_5.dump b/src/testdir/dumps/Test_customlist_info_popup_5.dump new file mode 100644 index 0000000000..37242aec78 --- /dev/null +++ b/src/testdir/dumps/Test_customlist_info_popup_5.dump @@ -0,0 +1,12 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @6| +0#0000001#ffd7ff255|a|p@1|l|e| @1|f| |f|r|u|i|t| @4| +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|b|a|n|a|n|a| |f| |f|r|u|i|t| @4| +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|c|a|r@1|o|t| |v| |v|e|g|e|t|a|b|l|e| | +0#4040ff13#ffffff0@46 +|~| @6| +0#0000001#ffd7ff255|p|l|a|i|n| @13| +0#4040ff13#ffffff0@46 +|:+0#0000000&|D|i|c|t|C|m|d| > @65 diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index efe73a1e6f..d58ff2b6d0 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -4641,6 +4641,49 @@ func Test_customlist_dict_completion() delfunc DictCompAbbr endfunc +func Test_customlist_dict_completion_info_popup() + CheckScreendump + + let lines =<< trim END + func DictComp(A, L, P) + return [ + \ {'word': 'apple', 'kind': 'f', 'menu': 'fruit', 'info': 'A red fruit'}, + \ {'word': 'banana', 'kind': 'f', 'menu': 'fruit', 'info': 'A yellow fruit'}, + \ {'word': 'carrot', 'kind': 'v', 'menu': 'vegetable', 'info': 'An orange vegetable'}, + \ 'plain', + \ ] + endfunc + command -nargs=1 -complete=customlist,DictComp DictCmd echo + set wildmenu wildoptions=pum completeopt=menu,popup + END + call writefile(lines, 'XTest_customlist_info_popup', 'D') + let rows = 12 + let buf = RunVimInTerminal('-S XTest_customlist_info_popup', {'rows': rows}) + + call term_sendkeys(buf, ":DictCmd \") + call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd apple') + 1)], g:test_timeout, ((rows - 4), 'A red fruit')) + call VerifyScreenDump(buf, 'Test_customlist_info_popup_1', {}) + + call term_sendkeys(buf, "\") + call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd banana') + 1)], g:test_timeout, ((rows - 3), 'A yellow fruit')) + call VerifyScreenDump(buf, 'Test_customlist_info_popup_2', {}) + + call term_sendkeys(buf, "\") + call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd carrot') + 1)], g:test_timeout, ((rows - 2), 'An orange vegetable')) + call VerifyScreenDump(buf, 'Test_customlist_info_popup_3', {}) + + call term_sendkeys(buf, "\") + call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd plain') + 1)], g:test_timeout, ((rows - 1), '^\~\s\+plain\s\+$')) + call VerifyScreenDump(buf, 'Test_customlist_info_popup_4', {}) + + call term_sendkeys(buf, "\") + call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd ') + 1)], g:test_timeout) + call VerifyScreenDump(buf, 'Test_customlist_info_popup_5', {}) + + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) +endfunc + func Test_custom_completion_with_glob() func TestGlobComplete(A, L, P) return split(glob('Xglob*'), "\n") diff --git a/src/version.c b/src/version.c index 59084a3625..81809c9ea4 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 */ +/**/ + 439, /**/ 438, /**/