mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.0517: when at the command line :redrawstatus does not work well
Problem: When at the command line :redrawstatus does not work well. Solution: Only update the statuslines instead of the screen. (closes #11180)
This commit is contained in:
@@ -8431,11 +8431,14 @@ ex_redrawstatus(exarg_T *eap UNUSED)
|
||||
status_redraw_all();
|
||||
else
|
||||
status_redraw_curbuf();
|
||||
if (msg_scrolled)
|
||||
if (msg_scrolled && (State & MODE_CMDLINE))
|
||||
return; // redraw later
|
||||
|
||||
RedrawingDisabled = 0;
|
||||
p_lz = FALSE;
|
||||
if (State & MODE_CMDLINE)
|
||||
redraw_statuslines();
|
||||
else
|
||||
update_screen(VIsual_active ? UPD_INVERTED : 0);
|
||||
RedrawingDisabled = r;
|
||||
p_lz = p;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|~+0#4040ff13#ffffff0| @73
|
||||
|~| @73
|
||||
| +3#0000000&@73|:
|
||||
| +3#0000000&@45|:|e|c|h|o| |"|o|n|e|\|n|t|w|o|\|n|t|h|r|e@1|\|n|f|o|u|r|"
|
||||
|o+0&&|n|e| @71
|
||||
|t|w|o| @71
|
||||
|t|h|r|e@1| @69
|
||||
|
@@ -4,5 +4,5 @@
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +3#0000000&@67|:|f|o@1|b|a|r
|
||||
|:+0&&|f|o@1|b|a|r> @67
|
||||
| +3#0000000&@55|:|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)
|
||||
|:+0&&|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)> @55
|
||||
|
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_3.dump
Normal file
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_3.dump
Normal file
@@ -0,0 +1,8 @@
|
||||
|~+0#4040ff13#ffffff0| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +3#0000000&@55|:|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)
|
||||
|:+0&&|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)| @55
|
||||
|:| @1|:|e|n|d|f|o|r> @64
|
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_4.dump
Normal file
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_4.dump
Normal file
@@ -0,0 +1,8 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +3#0000000&@55|:|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)
|
||||
|:+0&&|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)> @55
|
||||
@75
|
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_5.dump
Normal file
8
src/testdir/dumps/Test_redrawstatus_in_autocmd_5.dump
Normal file
@@ -0,0 +1,8 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +3#0000000&@66|:@1|e|n|d|f|o|r
|
||||
|:+0&&|f|o|r| |i|n| |i|n| |r|a|n|g|e|(|3|)| @55
|
||||
|:| @1|:|e|n|d|f|o|r> @64
|
@@ -216,7 +216,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')
|
||||
|
||||
@@ -226,8 +226,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, "\<Esc>:foobar")
|
||||
call term_sendkeys(buf, "\<Esc>: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, "\<CR>:endfor")
|
||||
call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_3', {})
|
||||
call term_sendkeys(buf, "\<CR>:set cmdheight=2\<CR>")
|
||||
" 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, "\<CR>:endfor")
|
||||
call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_5', {})
|
||||
|
||||
" clean up
|
||||
call term_sendkeys(buf, "\<CR>")
|
||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
517,
|
||||
/**/
|
||||
516,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user