fix(messages): validate msg_grid before silent! message with cmdheight=0

fixes #20316
This commit is contained in:
bfredl
2022-09-26 10:40:34 +02:00
parent 6596f7e136
commit db0ea1ab44
2 changed files with 14 additions and 0 deletions

View File

@@ -1401,6 +1401,7 @@ void msg_start(void)
if (!msg_scroll && full_screen) { // overwrite last message
if (cmdline_row >= Rows && !ui_has(kUIMessages)) {
msg_grid_validate();
msg_scroll_up(false, true);
msg_scrolled++;
cmdline_row = Rows - 1;

View File

@@ -1183,4 +1183,17 @@ describe('cmdheight=0', function()
{1:~ }|
]]}
end)
it('with silent! at startup', function()
clear{args={'-c', 'set cmdheight=0', '-c', 'autocmd VimEnter * silent! call Foo()'}}
screen:attach()
-- doesn't crash while not displaying silent! error message
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
]]}
end)
end)