patch 9.2.0439: completion: info popup not removed in cmdline mode

Commit: 
https://github.com/vim/vim/commit/3bfffcc29054faff2dbec2d765317ee09e9ef827
Author: zeertzjq <[email protected]>
Date:   Mon May 4 19:53:10 2026 +0000

    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/popupwin.c b/src/popupwin.c
index fb6e17d05..f01994380 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 000000000..0bb1ddb7b
--- /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 000000000..395911015
--- /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 000000000..f67d860c5
--- /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 000000000..0092776a9
--- /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 000000000..37242aec7
--- /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 efe73a1e6..d58ff2b6d 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 <q-args>
+    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 \<Tab>")
+  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, "\<Tab>")
+  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, "\<Tab>")
+  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, "\<Tab>")
+  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, "\<Tab>")
+  call WaitForTermCurPosAndLinesToMatch(buf, [rows, (strlen(':DictCmd ') + 
1)], g:test_timeout)
+  call VerifyScreenDump(buf, 'Test_customlist_info_popup_5', {})
+
+  call term_sendkeys(buf, "\<Esc>")
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_custom_completion_with_glob()
   func TestGlobComplete(A, L, P)
     return split(glob('Xglob*'), "
")
diff --git a/src/version.c b/src/version.c
index 59084a362..81809c9ea 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,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wJzSW-005sHA-44%40256bit.org.

Raspunde prin e-mail lui