patch 9.1.1200: cmdline pum not cleared for input() completion
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>
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 597f78d..d218277 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -419,10 +419,15 @@
* 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);
@@ -434,12 +439,16 @@
// 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);
}
@@ -1022,7 +1031,7 @@
// 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;