mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(ui): allow redrawing statusline when msgsep is used (#20337)
This commit is contained in:
@@ -6088,7 +6088,7 @@ static void ex_redrawstatus(exarg_T *eap)
|
|||||||
} else {
|
} else {
|
||||||
status_redraw_curbuf();
|
status_redraw_curbuf();
|
||||||
}
|
}
|
||||||
if (msg_scrolled && (State & MODE_CMDLINE)) {
|
if (msg_scrolled && !msg_use_msgsep() && (State & MODE_CMDLINE)) {
|
||||||
return; // redraw later
|
return; // redraw later
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -774,11 +774,11 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init
|
|||||||
|
|
||||||
// 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) {
|
if (!cmd_silent && (msg_scrolled == 0 || msg_use_msgsep())) {
|
||||||
bool found_one = false;
|
bool found_one = false;
|
||||||
|
|
||||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||||
if (*p_stl != NUL || *wp->w_p_stl != NUL) {
|
if (*p_stl != NUL || *wp->w_p_stl != NUL || *p_wbr != NUL || *wp->w_p_wbr != NUL) {
|
||||||
wp->w_redr_status = true;
|
wp->w_redr_status = true;
|
||||||
found_one = true;
|
found_one = true;
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ local source = helpers.source
|
|||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
local assert_alive = helpers.assert_alive
|
local assert_alive = helpers.assert_alive
|
||||||
local uname = helpers.uname
|
local uname = helpers.uname
|
||||||
|
local exec = helpers.exec
|
||||||
local eval = helpers.eval
|
local eval = helpers.eval
|
||||||
local eq = helpers.eq
|
local eq = helpers.eq
|
||||||
|
|
||||||
@@ -821,12 +822,23 @@ describe('statusline is redrawn on entering cmdline', function()
|
|||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('but not with scrolled messages', function()
|
it('with scrolled messages and msgsep', function()
|
||||||
command('set statusline=%{mode()}')
|
screen:try_resize(35,14)
|
||||||
screen:try_resize(35,10)
|
exec([[
|
||||||
|
let g:count = 0
|
||||||
|
autocmd CmdlineEnter * let g:count += 1
|
||||||
|
split
|
||||||
|
resize 1
|
||||||
|
setlocal statusline=%{mode()}%{g:count}
|
||||||
|
setlocal winbar=%{mode()}%{g:count}
|
||||||
|
]])
|
||||||
feed(':echoerr doesnotexist<cr>')
|
feed(':echoerr doesnotexist<cr>')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
|
{9:c1 }|
|
||||||
|
|
|
|
||||||
|
{3:c1 }|
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
@@ -839,8 +851,12 @@ describe('statusline is redrawn on entering cmdline', function()
|
|||||||
]]}
|
]]}
|
||||||
feed(':echoerr doesnotexist<cr>')
|
feed(':echoerr doesnotexist<cr>')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
|
{9:c2 }|
|
||||||
|
|
|
||||||
|
{3:c2 }|
|
||||||
|
|
|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
{3: }|
|
{3: }|
|
||||||
{4:E121: Undefined variable: doesnotex}|
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
{4:ist} |
|
{4:ist} |
|
||||||
@@ -851,6 +867,78 @@ describe('statusline is redrawn on entering cmdline', function()
|
|||||||
{5:inue}^ |
|
{5:inue}^ |
|
||||||
]]}
|
]]}
|
||||||
|
|
||||||
|
feed(':echoerr doesnotexist<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{9:c3 }|
|
||||||
|
|
|
||||||
|
{3:c3 }|
|
||||||
|
{3: }|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{5:inue}^ |
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{9:n3 }|
|
||||||
|
^ |
|
||||||
|
{3:n3 }|
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{2:[No Name] }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('but not with scrolled messages without msgsep', function()
|
||||||
|
screen:try_resize(35,10)
|
||||||
|
exec([[
|
||||||
|
let g:count = 0
|
||||||
|
autocmd CmdlineEnter * let g:count += 1
|
||||||
|
set display-=msgsep
|
||||||
|
set statusline=%{mode()}%{g:count}
|
||||||
|
]])
|
||||||
|
feed(':echoerr doesnotexist<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{3:c1 }|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{5:inue}^ |
|
||||||
|
]]}
|
||||||
|
feed(':echoerr doesnotexist<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{3:c1 }|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
|
{4:ist} |
|
||||||
|
{5:Press ENTER or type command to cont}|
|
||||||
|
{5:inue}^ |
|
||||||
|
]]}
|
||||||
|
|
||||||
feed(':echoerr doesnotexist<cr>')
|
feed(':echoerr doesnotexist<cr>')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
{4:E121: Undefined variable: doesnotex}|
|
{4:E121: Undefined variable: doesnotex}|
|
||||||
@@ -875,7 +963,7 @@ describe('statusline is redrawn on entering cmdline', function()
|
|||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{3:n }|
|
{3:n3 }|
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
@@ -1238,4 +1326,36 @@ describe('cmdheight=0', function()
|
|||||||
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1};
|
||||||
}}
|
}}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('winbar is redrawn on entering cmdline and :redrawstatus #20336', function()
|
||||||
|
exec([[
|
||||||
|
set cmdheight=0
|
||||||
|
set winbar=%{mode()}%=:%{getcmdline()}
|
||||||
|
]])
|
||||||
|
feed(':')
|
||||||
|
screen:expect([[
|
||||||
|
{3:c :}|
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:^ |
|
||||||
|
]])
|
||||||
|
feed('echo')
|
||||||
|
-- not redrawn yet
|
||||||
|
screen:expect([[
|
||||||
|
{3:c :}|
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:echo^ |
|
||||||
|
]])
|
||||||
|
command('redrawstatus')
|
||||||
|
screen:expect([[
|
||||||
|
{3:c :echo}|
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
:echo^ |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user