mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
vim-patch:8.2.2686: status line is not updated when going to cmdline mode
Problem: Status line is not updated when going to cmdline mode.
Solution: Redraw status lines if 'statusline' is set and going to status
line mode. (based on patch from Justin M. Keyes et al.,
closes vim/vim#8044)
ce0b75711a
This commit is contained in:
@@ -775,9 +775,9 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
|
|||||||
redrawcmd();
|
redrawcmd();
|
||||||
}
|
}
|
||||||
|
|
||||||
// redraw the statusline for statuslines that display the current mode
|
// Redraw the statusline in case it uses the current mode using the mode()
|
||||||
// using the mode() function.
|
// function.
|
||||||
if (!cmd_silent && msg_scrolled == 0) {
|
if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL) {
|
||||||
curwin->w_redr_status = true;
|
curwin->w_redr_status = true;
|
||||||
redraw_statuslines();
|
redraw_statuslines();
|
||||||
}
|
}
|
||||||
|
@@ -440,6 +440,27 @@ func Test_statusline_removed_group()
|
|||||||
call delete('XTest_statusline')
|
call delete('XTest_statusline')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_statusline_using_mode()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
set laststatus=2
|
||||||
|
let &statusline = '-%{mode()}-'
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XTest_statusline')
|
||||||
|
|
||||||
|
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 5, 'cols': 50})
|
||||||
|
call VerifyScreenDump(buf, 'Test_statusline_mode_1', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":")
|
||||||
|
call VerifyScreenDump(buf, 'Test_statusline_mode_2', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call term_sendkeys(buf, "\<CR>")
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XTest_statusline')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_statusline_after_split_vsplit()
|
func Test_statusline_after_split_vsplit()
|
||||||
only
|
only
|
||||||
|
|
||||||
|
@@ -456,6 +456,8 @@ describe('ui/ext_messages', function()
|
|||||||
{1:~ }|
|
{1:~ }|
|
||||||
]], messages={
|
]], messages={
|
||||||
{kind="echomsg", content={{"stuff"}}},
|
{kind="echomsg", content={{"stuff"}}},
|
||||||
|
}, showmode={
|
||||||
|
{ "-- INSERT --", 3 }
|
||||||
}}
|
}}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user