mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
fix(messages): only msg_clear for UPD_CLEAR #34688
Problem: "msg_clear" is emitted after resizing the screen and during startup. Solution: Only emit "msg_clear" when `redraw_type == UPD_CLEAR`.
This commit is contained in:
@ -264,9 +264,6 @@ void screenclear(void)
|
||||
msg_grid_invalid = false;
|
||||
clear_cmdline = true;
|
||||
}
|
||||
if (ui_has(kUIMessages)) {
|
||||
ui_call_msg_clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// Unlike cmdline "one_key" prompts, the message part of the prompt is not stored
|
||||
@ -570,6 +567,9 @@ int update_screen(void)
|
||||
screenclear(); // will reset clear_cmdline
|
||||
// and set UPD_NOT_VALID for each window
|
||||
cmdline_screen_cleared(); // clear external cmdline state
|
||||
if (ui_has(kUIMessages)) {
|
||||
ui_call_msg_clear();
|
||||
}
|
||||
type = UPD_NOT_VALID;
|
||||
// must_redraw may be set indirectly, avoid another redraw later
|
||||
must_redraw = 0;
|
||||
|
@ -160,5 +160,14 @@ describe('messages2', function()
|
||||
]])
|
||||
command('echo ""')
|
||||
screen:expect_unchanged()
|
||||
-- Or a screen resize
|
||||
screen:try_resize(screen._width, screen._height - 1)
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*9
|
||||
{1:~ }┌───┐|
|
||||
{1:~ }│{4:foo}│|
|
||||
{1:~ }└───┘|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user