Patch 9.0.0507
Problem: Command line cleared when using :redrawstatus in CmdlineChanged
autocommand event.
Solution: Postpone the redraw. (closes #11162)
Files: src/ex_docmd.c, src/testdir/test_cmdline.vim,
src/testdir/dumps/Test_redrawstatus_in_autocmd_1.dump
*** ../vim-9.0.0506/src/ex_docmd.c 2022-09-15 21:45:57.485522072 +0100
--- src/ex_docmd.c 2022-09-19 21:11:21.946052934 +0100
***************
*** 8427,8438 ****
int r = RedrawingDisabled;
int p = p_lz;
- RedrawingDisabled = 0;
- p_lz = FALSE;
if (eap->forceit)
status_redraw_all();
else
status_redraw_curbuf();
update_screen(VIsual_active ? UPD_INVERTED : 0);
RedrawingDisabled = r;
p_lz = p;
--- 8427,8441 ----
int r = RedrawingDisabled;
int p = p_lz;
if (eap->forceit)
status_redraw_all();
else
status_redraw_curbuf();
+ if (State & MODE_CMDLINE)
+ return; // redraw later
+
+ RedrawingDisabled = 0;
+ p_lz = FALSE;
update_screen(VIsual_active ? UPD_INVERTED : 0);
RedrawingDisabled = r;
p_lz = p;
*** ../vim-9.0.0506/src/testdir/test_cmdline.vim 2022-09-15
21:45:57.485522072 +0100
--- src/testdir/test_cmdline.vim 2022-09-19 21:09:42.586226861 +0100
***************
*** 210,215 ****
--- 210,234 ----
call StopVimInTerminal(buf)
endfunc
+ func Test_redrawstatus_in_autocmd()
+ CheckScreendump
+
+ let lines =<< trim END
+ set cmdheight=2
+ autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus |
endif
+ END
+ call writefile(lines, 'XTest_redrawstatus', 'D')
+
+ let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8})
+ call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>")
+ call term_sendkeys(buf, ":foobar")
+ call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<CR>")
+ call StopVimInTerminal(buf)
+ endfunc
+
func Test_changing_cmdheight()
CheckScreendump
*** ../vim-9.0.0506/src/testdir/dumps/Test_redrawstatus_in_autocmd_1.dump
2022-09-19 21:12:21.661985669 +0100
--- src/testdir/dumps/Test_redrawstatus_in_autocmd_1.dump 2022-09-19
21:09:45.466221669 +0100
***************
*** 0 ****
--- 1,8 ----
+ |~+0#4040ff13#ffffff0| @73
+ |~| @73
+ |~| @73
+ |o+0#0000000&|n|e| @71
+ |t|w|o| @71
+ |t|h|r|e@1| @69
+ |f|o|u|r| @70
+ |:|f|o@1|b|a|r> @67
*** ../vim-9.0.0506/src/version.c 2022-09-19 18:20:03.795886974 +0100
--- src/version.c 2022-09-19 21:03:54.214843339 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 507,
/**/
--
hundred-and-one symptoms of being an internet addict:
95. Only communication in your household is through email.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 on the web visit
https://groups.google.com/d/msgid/vim_dev/20220919201707.21F7F1C0852%40moolenaar.net.