fix(showcmd): assert failure with cmdheight=0 (#21536)

This commit is contained in:
zeertzjq
2022-12-26 14:04:46 +08:00
committed by GitHub
parent 522b15e2a4
commit 94ce25065b
2 changed files with 16 additions and 0 deletions

View File

@@ -1990,6 +1990,9 @@ static void display_showcmd(void)
return;
}
// 'showcmdloc' is "last" or empty
if (p_ch == 0 && !ui_has(kUIMessages)) {
return;
}
if (ui_has(kUIMessages)) {
MAXSIZE_TEMP_ARRAY(content, 1);

View File

@@ -1351,4 +1351,17 @@ describe('cmdheight=0', function()
{1:~ }│{1:~ }|
]])
end)
it('no assert failure with showcmd', function()
command('set showcmd cmdheight=0')
feed('d')
screen:expect([[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
]])
assert_alive()
end)
end)