mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 05:16:09 +00:00
vim-patch:9.0.0512: cannot redraw the status lines when editing a command
Problem: Cannot redraw the status lines when editing a command.
Solution: Only postpone the redraw when messages have scrolled.
(closes vim/vim#11170)
c14bfc31d9
This commit is contained in:
@@ -6094,7 +6094,7 @@ static void ex_redrawstatus(exarg_T *eap)
|
||||
} else {
|
||||
status_redraw_curbuf();
|
||||
}
|
||||
if (State & MODE_CMDLINE) {
|
||||
if (msg_scrolled) {
|
||||
return; // redraw later
|
||||
}
|
||||
|
||||
|
@@ -152,15 +152,20 @@ func Test_redrawstatus_in_autocmd()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
set cmdheight=2
|
||||
set laststatus=2
|
||||
set statusline=%=:%{getcmdline()}
|
||||
autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus | endif
|
||||
END
|
||||
call writefile(lines, 'XTest_redrawstatus', 'D')
|
||||
|
||||
let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8})
|
||||
" :redrawstatus is postponed if messages have scrolled
|
||||
call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>")
|
||||
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 VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {})
|
||||
|
||||
" clean up
|
||||
call term_sendkeys(buf, "\<CR>")
|
||||
|
Reference in New Issue
Block a user