mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
20a124a6e0
commit
3bfffcc290
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -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
|
||||
+12
@@ -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
|
||||
+12
@@ -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
|
||||
+12
@@ -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
|
||||
+12
@@ -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
|
||||
@@ -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*'), "\n")
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
439,
|
||||
/**/
|
||||
438,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user