fix(intro): crash on small screen #38397

This commit is contained in:
Justin M. Keyes
2026-03-20 18:23:39 -04:00
committed by GitHub
parent bc00aec21c
commit cd71221250
2 changed files with 15 additions and 6 deletions

View File

@@ -4251,7 +4251,7 @@ void intro_message(bool colon)
}
}
if (*mesg != NUL) {
if (*mesg != NUL && row < Rows - 1) {
do_intro_line(row, mesg, colon, i < 3);
}
row++;

View File

@@ -1768,11 +1768,12 @@ describe('ui/builtin messages', function()
-- ignore final whitespace inside string
-- luacheck: push ignore
eq(
[[--- Syntax items ---
vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vimCommentGroup,vimCommentString
match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString
match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString
links to Comment]],
t.dedent [[
--- Syntax items ---
vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vimCommentGroup,vimCommentString
match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString
match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString
links to Comment]],
exec_capture('syntax list vimComment')
)
-- luacheck: pop
@@ -2176,6 +2177,14 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
assert_alive()
end)
it(':intro with small screen #38396', function()
screen:try_resize(80, 6)
feed(':intro<CR>')
screen:expect({ any = 'NVIM' })
feed('<CR>')
assert_alive()
end)
it('no wait return before delayed exception error message', function()
screen:try_resize(70, 7)
feed('ia<esc>:lua vim.cmd.quit()<CR>')