mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
fix(messages): do not crash on cmdheight=0 and g< redisplay
fixes #20153
This commit is contained in:
@@ -2955,6 +2955,11 @@ static int do_more_prompt(int typed_char)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// First display any text that we scrolled back.
|
// First display any text that we scrolled back.
|
||||||
|
// if p_ch=0 we need to allocate a line for "press enter" messages!
|
||||||
|
if (cmdline_row >= Rows && !ui_has(kUIMessages)) {
|
||||||
|
msg_scroll_up(true, false);
|
||||||
|
msg_scrolled++;
|
||||||
|
}
|
||||||
while (toscroll > 0 && mp_last != NULL) {
|
while (toscroll > 0 && mp_last != NULL) {
|
||||||
if (msg_do_throttle() && !msg_grid.throttled) {
|
if (msg_do_throttle() && !msg_grid.throttled) {
|
||||||
// Tricky: we redraw at one line higher than usual. Therefore
|
// Tricky: we redraw at one line higher than usual. Therefore
|
||||||
|
@@ -2020,4 +2020,55 @@ aliquip ex ea commodo consequat.]])
|
|||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('with cmdheight=0 does not crash with g<', function()
|
||||||
|
command('set cmdheight=0')
|
||||||
|
feed(':ls<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{12: }|
|
||||||
|
:ls |
|
||||||
|
1 %a "[No Name]" |
|
||||||
|
line 1 |
|
||||||
|
{4:Press ENTER or type command to cont}|
|
||||||
|
{4:inue}^ |
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^ |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('g<lt>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{12: }|
|
||||||
|
:ls |
|
||||||
|
1 %a "[No Name]" |
|
||||||
|
line 1 |
|
||||||
|
{4:Press ENTER or type command to cont}|
|
||||||
|
{4:inue}^ |
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('<cr>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^ |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user