vim-patch:8.2.2737: status line not updated when local 'statusline' option set (#14325)

Problem:    Status line not updated when local 'statusline' option set.
Solution:   Check the 'statusline' option of each window.
d8db838392
This commit is contained in:
bphilly96
2021-04-09 04:14:08 +01:00
committed by GitHub
parent ed3c0a27c7
commit 82ac44d01f
2 changed files with 17 additions and 7 deletions

View File

@@ -784,10 +784,19 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
// Redraw the statusline in case it uses the current mode using the mode() // Redraw the statusline in case it uses the current mode using the mode()
// function. // function.
if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL) { if (!cmd_silent && msg_scrolled == 0) {
curwin->w_redr_status = true; bool found_one = false;
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (*p_stl != NUL || *wp->w_p_stl != NUL) {
wp->w_redr_status = true;
found_one = true;
}
}
if (found_one) {
redraw_statuslines(); redraw_statuslines();
} }
}
did_emsg = false; did_emsg = false;
got_int = false; got_int = false;

View File

@@ -444,19 +444,20 @@ func Test_statusline_using_mode()
CheckScreendump CheckScreendump
let lines =<< trim END let lines =<< trim END
set laststatus=2 setlocal statusline=-%{mode()}-
let &statusline = '-%{mode()}-' split
setlocal statusline=+%{mode()}+
END END
call writefile(lines, 'XTest_statusline') call writefile(lines, 'XTest_statusline')
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 5, 'cols': 50}) let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 7, 'cols': 50})
call VerifyScreenDump(buf, 'Test_statusline_mode_1', {}) call VerifyScreenDump(buf, 'Test_statusline_mode_1', {})
call term_sendkeys(buf, ":") call term_sendkeys(buf, ":")
call VerifyScreenDump(buf, 'Test_statusline_mode_2', {}) call VerifyScreenDump(buf, 'Test_statusline_mode_2', {})
" clean up " clean up
call term_sendkeys(buf, "\<CR>") call term_sendkeys(buf, "close\<CR>")
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
call delete('XTest_statusline') call delete('XTest_statusline')
endfunc endfunc