Merge pull request #20350 from bfredl/cmdfix

fix(messages): validate msg_grid before silent! message with cmdheight=0
This commit is contained in:
bfredl 2022-09-26 11:25:15 +02:00 committed by GitHub
commit fe045bfd5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)