1
0
forked from aniani/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 #8044)
This commit is contained in:
Bram Moolenaar
2021-04-01 18:47:14 +02:00
parent 49c51b825a
commit ce0b75711a
5 changed files with 42 additions and 0 deletions

View File

@@ -1706,6 +1706,15 @@ getcmdline_int(
// and execute commands. Display may be messed up a bit. // and execute commands. Display may be messed up a bit.
if (did_emsg) if (did_emsg)
redrawcmd(); redrawcmd();
// Redraw the statusline in case it uses the current mode using the mode()
// function.
if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL)
{
curwin->w_redr_status = TRUE;
redraw_statuslines();
}
did_emsg = FALSE; did_emsg = FALSE;
got_int = FALSE; got_int = FALSE;

View File

@@ -0,0 +1,5 @@
> +0&#ffffff0@49
|~+0#4040ff13&| @48
|~| @48
|-+3#0000000&|n|-| @46
| +0&&@49

View File

@@ -0,0 +1,5 @@
| +0&#ffffff0@49
|~+0#4040ff13&| @48
|~| @48
|-+3#0000000&|c|-| @46
|:+0&&> @48

View File

@@ -448,6 +448,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

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2686,
/**/ /**/
2685, 2685,
/**/ /**/