// and execute commands. Display may be messed up a bit.
if (did_emsg)
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;
got_int = FALSE;
call delete('XTest_statusline')
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()
only