fix(window): 'winbar' in single-row win overlaps global 'statusline' #41188

This commit is contained in:
Barrett Ruth
2026-08-07 06:06:23 -05:00
committed by GitHub
parent 0105f15201
commit bc9d27b0bc
2 changed files with 23 additions and 6 deletions

View File

@@ -7273,16 +7273,13 @@ static bool resize_frame_for_status(frame_T *fr)
// @return Success or failure.
static bool resize_frame_for_winbar(frame_T *fr)
{
win_T *wp = fr->fr_win;
frame_T *fp = find_horizontally_resizable_frame(fr);
int old_height = fr->fr_height;
if (fp == NULL || fp == fr) {
frame_setheight(fr, old_height + 1, false);
if (fr->fr_height == old_height) {
emsg(_(e_noroom));
return false;
}
frame_new_height(fp, fp->fr_height - 1, false, false, false);
win_new_height(wp, wp->w_height + 1);
frame_fix_height(wp);
win_comp_pos();
return true;

View File

@@ -570,6 +570,26 @@ describe('winbar', function()
|
]])
end)
it('making room for a winbar does not overlap the global statusline #41140', function()
n.exec([[
set winbar= laststatus=3
vsplit
split
resize 1
setlocal winbar=top
resize 1000
]])
screen:expect([[
{1:top }│ |
^ │{3:~ }|
{3:~ }│{3:~ }|*7
──────────────────────────────┤{3:~ }|
│{3:~ }|
{4:[No Name] }|
|
]])
end)
end)
describe('local winbar with tabs', function()