Problem: Cmdline pum not cleared for input() completion.
Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(),
like what is done in wildmenu_cleanup() (zeertzjq).
fixes: #16874
closes: #16876
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
* items and refresh the screen.
*/
void
-cmdline_pum_remove(void)
+cmdline_pum_remove(cmdline_info_T *cclp UNUSED)
{
int save_p_lz = p_lz;
int save_KeyTyped = KeyTyped;
+#ifdef FEAT_EVAL
+ int save_RedrawingDisabled = RedrawingDisabled;
+ if (cclp->input_fn)
+ RedrawingDisabled = 0;
+#endif
pum_undisplay();
VIM_CLEAR(compl_match_array);
// When a function is called (e.g. for 'foldtext') KeyTyped might be reset
// as a side effect.
KeyTyped = save_KeyTyped;
+#ifdef FEAT_EVAL
+ if (cclp->input_fn)
+ RedrawingDisabled = save_RedrawingDisabled;
+#endif
}
void
cmdline_pum_cleanup(cmdline_info_T *cclp)
{
- cmdline_pum_remove();
+ cmdline_pum_remove(cclp);
wildmenu_cleanup(cclp);
}
// The entries from xp_files may be used in the PUM, remove it.
if (compl_match_array != NULL)
- cmdline_pum_remove();
+ cmdline_pum_remove(get_cmdline_info());
}
xp->xp_selected = 0;
if (end_wildmenu)
{
if (cmdline_pum_active())
- cmdline_pum_remove();
+ cmdline_pum_remove(&ccline);
if (xpc.xp_numfiles != -1)
(void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
did_wild_list = FALSE;
// if certain special keys like <Esc> or <C-\> were used as wildchar. Make
// sure to still clean up to avoid memory corruption.
if (cmdline_pum_active())
- cmdline_pum_remove();
+ cmdline_pum_remove(&ccline);
wildmenu_cleanup(&ccline);
did_wild_list = FALSE;
wim_index = 0;
int nextwild(expand_T *xp, int type, int options, int escape);
void cmdline_pum_display(void);
int cmdline_pum_active(void);
-void cmdline_pum_remove(void);
+void cmdline_pum_remove(cmdline_info_T *cclp);
void cmdline_pum_cleanup(cmdline_info_T *cclp);
int cmdline_compl_startcol(void);
char_u *cmdline_compl_pattern(void);
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|C+0#0000000&|o|m@1|a|n|d|?| > @65
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|e+0#0000001#ffff4012|c|h|o| +3#0000000#ffffff0@1|e|c|h|o|c|o|n|s|o|l|e| @1|e|c|h|o|e|r@1| @1|e|c|h|o|h|l| @1|e|c|h|o|m|s|g| @1|e|c|h|o|n| @1|e|c|h|o|w|i|n|d|o|w| @12
+|C+0&&|o|m@1|a|n|d|?| |e|c|h|o> @61
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|C+0#0000000&|o|m@1|a|n|d|?| |e|c|h|o| > @60
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|b+0#0000001#ffff4012|u|f|n|a|m|e|(| +3#0000000#ffffff0@1|b|u|f|n|r|(| @58
+|C+0&&|o|m@1|a|n|d|?| |e|c|h|o| |b|u|f|n|a|m|e|(> @52
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|C+0#0000000&|o|m@1|a|n|d|?| > @65
--- /dev/null
+| +0#0000001#e0e0e08|e|c|h|o| @10| +0#0000000#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|c|o|n|s|o|l|e| @3| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|e|r@1| @7| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|h|l| @8| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|m|s|g| @7| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|n| @9| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|e|c|h|o|w|i|n|d|o|w| @4| +0#4040ff13#ffffff0@58
+|C+0#0000000&|o|m@1|a|n|d|?| |e|c|h|o> @61
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|C+0#0000000&|o|m@1|a|n|d|?| |e|c|h|o| > @60
--- /dev/null
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @3| +0#0000001#e0e0e08|b|u|f|n|a|m|e|(| @6| +0#4040ff13#ffffff0@53
+|~| @3| +0#0000001#ffd7ff255|b|u|f|n|r|(| @8| +0#4040ff13#ffffff0@53
+|C+0#0000000&|o|m@1|a|n|d|?| |e|c|h|o| |b|u|f|n|a|m|e|(> @52
call StopVimInTerminal(buf)
endfunc
+func Test_wildmenu_with_input_func()
+ CheckScreendump
+
+ let buf = RunVimInTerminal('-c "set wildmenu"', {'rows': 8})
+
+ call term_sendkeys(buf, ":call input('Command? ', '', 'command')\<CR>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_1', {})
+ call term_sendkeys(buf, "ech\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_2', {})
+ call term_sendkeys(buf, "\<Space>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_3', {})
+ call term_sendkeys(buf, "bufn\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_4', {})
+ call term_sendkeys(buf, "\<CR>")
+
+ call term_sendkeys(buf, ":set wildoptions+=pum\<CR>")
+
+ call term_sendkeys(buf, ":call input('Command? ', '', 'command')\<CR>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_5', {})
+ call term_sendkeys(buf, "ech\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_6', {})
+ call term_sendkeys(buf, "\<Space>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_7', {})
+ call term_sendkeys(buf, "bufn\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_input_func_8', {})
+ call term_sendkeys(buf, "\<CR>")
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_redraw_in_autocmd()
CheckScreendump
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1200,
/**/
1199,
/**/