From bc9d27b0bc04307a1e1c2b81713ac7372e46da95 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Fri, 7 Aug 2026 06:06:23 -0500 Subject: [PATCH] fix(window): 'winbar' in single-row win overlaps global 'statusline' #41188 --- src/nvim/window.c | 9 +++------ test/functional/ui/winbar_spec.lua | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/nvim/window.c b/src/nvim/window.c index a1e712c2cd..3c2874def2 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -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; diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index d88aa55672..95f73db12e 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -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()