]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set v8.2.4481
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Feb 2022 14:28:31 +0000 (14:28 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Feb 2022 14:28:31 +0000 (14:28 +0000)
Problem:    Cmdline popup menu not removed when 'lazyredraw' is set.
Solution:   Temporarily reset 'lazyredraw' when removing the popup menu.
            (closes #9857)

src/cmdexpand.c
src/testdir/dumps/Test_wildmenu_pum_41.dump [new file with mode: 0644]
src/testdir/test_cmdline.vim
src/version.c

index 84dc64342430c5b727608ce5a596922dab2255c8..e9db8cfc95e5599c76c6f02877270d0eeedaf23e 100644 (file)
@@ -377,9 +377,13 @@ int cmdline_pum_active(void)
  */
 void cmdline_pum_remove(void)
 {
+    int save_p_lz = p_lz;
+
     pum_undisplay();
     VIM_CLEAR(compl_match_array);
+    p_lz = FALSE;  // avoid the popup menu hanging around
     update_screen(0);
+    p_lz = save_p_lz;
     redrawcmd();
 }
 
diff --git a/src/testdir/dumps/Test_wildmenu_pum_41.dump b/src/testdir/dumps/Test_wildmenu_pum_41.dump
new file mode 100644 (file)
index 0000000..6f23d92
--- /dev/null
@@ -0,0 +1,10 @@
+| +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000001#e0e0e08|a|b@1|r|e|v|i|a|t|e| @4| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|a|b|c|l|e|a|r| @7| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|a|b|o|v|e|l|e|f|t| @5| +0#4040ff13#ffffff0@58
+| +0#0000001#ffd7ff255|a|b|s|t|r|a|c|t| @6| +0#4040ff13#ffffff0@58
+|:+0#0000000&|a|b@1|r|e|v|i|a|t|e> @63
index d7e46d989811c2410c18570ece44e4c01e69923e..d7a8c4a3fcffcadfcfcc5d83456ae6252c9de16e 100644 (file)
@@ -2181,6 +2181,11 @@ func Test_wildmenu_pum()
       set tabline=%!MyTabLine()
       set showtabline=2
     endfunc
+
+    func DoFeedKeys()
+      let &wildcharm = char2nr("\t")
+      call feedkeys(":edit $VIMRUNTIME/\<Tab>\<Left>\<C-U>ab\<Tab>")
+    endfunc
   [CODE]
   call writefile(commands, 'Xtest')
 
@@ -2378,6 +2383,12 @@ func Test_wildmenu_pum()
   call term_sendkeys(buf, "\<Esc>")
   call VerifyScreenDump(buf, 'Test_wildmenu_pum_40', {})
 
+  " popup is cleared also when 'lazyredraw' is set
+  call term_sendkeys(buf, ":set showtabline=1 laststatus=1 lazyredraw\<CR>")
+  call term_sendkeys(buf, ":call DoFeedKeys()\<CR>")
+  call VerifyScreenDump(buf, 'Test_wildmenu_pum_41', {})
+  call term_sendkeys(buf, "\<Esc>")
+
   call term_sendkeys(buf, "\<C-U>\<CR>")
   call StopVimInTerminal(buf)
   call delete('Xtest')
index b9b6aac63b168d1f3059d59ae236f0a74c6d359b..11b4bd58b6450b6e1ec4b1ddd936fa32667b768a 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4481,
 /**/
     4480,
 /**/