fix(window): fix equalization with cmdheight=0 (#20369)

This commit is contained in:
zeertzjq
2022-09-28 06:22:11 +08:00
committed by GitHub
parent d84abfeb1d
commit e6c214033a
2 changed files with 58 additions and 1 deletions

View File

@@ -2239,7 +2239,7 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
// Compute maximum number of windows vertically in this frame. // Compute maximum number of windows vertically in this frame.
n = frame_minheight(topfr, NOWIN); n = frame_minheight(topfr, NOWIN);
// add one for the bottom window if it doesn't have a statusline or separator // add one for the bottom window if it doesn't have a statusline or separator
if (row + height == cmdline_row && p_ls == 0) { if (row + height >= cmdline_row && p_ls == 0) {
extra_sep = STATUS_HEIGHT; extra_sep = STATUS_HEIGHT;
} else if (global_stl_height() > 0) { } else if (global_stl_height() > 0) {
extra_sep = 1; extra_sep = 1;

View File

@@ -1358,4 +1358,61 @@ describe('cmdheight=0', function()
:echo^ | :echo^ |
]]) ]])
end) end)
it('window equalization with laststatus=0 #20367', function()
screen:try_resize(60, 9)
command('set cmdheight=0 laststatus=0')
command('vsplit')
screen:expect([[
^ │ |
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
]])
feed(':')
command('split')
feed('<Esc>')
screen:expect([[
^ │ |
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{2:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
]])
command('resize 2')
screen:expect([[
^ │ |
{1:~ }│{1:~ }|
{2:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
]])
feed(':')
command('wincmd =')
feed('<Esc>')
screen:expect([[
^ │ |
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{2:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
{1:~ }│{1:~ }|
]])
end)
end) end)