From ad1f353fe1aeb54144a34d1a0de8e318bd5113aa Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 21 Sep 2022 06:47:29 +0800 Subject: vim-patch:9.0.0517: when at the command line :redrawstatus does not work well (#20266) Problem: When at the command line :redrawstatus does not work well. Solution: Only update the statuslines instead of the screen. (closes vim/vim#11180) https://github.com/vim/vim/commit/320d910064320f894a09ffdd1cd800ff5371e97f --- src/nvim/testdir/test_cmdline.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 9fc92b8f25..60f6930c35 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -154,7 +154,7 @@ func Test_redrawstatus_in_autocmd() let lines =<< trim END set laststatus=2 set statusline=%=:%{getcmdline()} - autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus | endif + autocmd CmdlineChanged * redrawstatus END call writefile(lines, 'XTest_redrawstatus', 'D') @@ -164,8 +164,17 @@ func Test_redrawstatus_in_autocmd() call term_sendkeys(buf, ":foobar") call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {}) " it is not postponed if messages have not scrolled - call term_sendkeys(buf, "\:foobar") + call term_sendkeys(buf, "\:for in in range(3)") call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {}) + " with cmdheight=1 messages have scrolled when typing :endfor + call term_sendkeys(buf, "\:endfor") + call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_3', {}) + call term_sendkeys(buf, "\:set cmdheight=2\") + " with cmdheight=2 messages haven't scrolled when typing :for or :endfor + call term_sendkeys(buf, ":for in in range(3)") + call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_4', {}) + call term_sendkeys(buf, "\:endfor") + call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_5', {}) " clean up call term_sendkeys(buf, "\") -- cgit