commit 28355050a8781d9f8f22edd3f4448d4451450d41
parent f09225e6dd97dd419063e10d05e00f9d5dadc7a8
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu, 9 Oct 2025 07:49:05 +0800
vim-patch:9.1.1839: Window may have wrong height if resized from another tabpage (#36093)
Problem: Window may have wrong height if resized from another tabpage.
Solution: Improve check for whether a tabline has been added (zeertzjq).
fixes: vim/vim#18518
closes: vim/vim#18519
https://github.com/vim/vim/commit/bd3b9580273e890951135686875de9bd49e798bc
Diffstat:
2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua
@@ -407,3 +407,27 @@ it("'winfixwidth/height' does not leave stray vseps/statuslines", function()
eq(2, fn.winheight(1))
eq(4, fn.winheight(2))
end)
+
+-- oldtest: Test_resize_from_another_tabpage()
+it('resizing window from another tabpage', function()
+ clear()
+ local screen = Screen.new(75, 8)
+ screen:add_extra_attr_ids({
+ [100] = { foreground = Screen.colors.Magenta1, bold = true },
+ })
+ exec([[
+ set laststatus=2
+ vnew
+ let w = win_getid()
+ tabnew
+ call win_execute(w, 'vertical resize 20')
+ tabprev
+ ]])
+ screen:expect([[
+ {5: }{100:2}{5: [No Name] }{24: [No Name] }{2: }{24:X}|
+ ^ │ |
+ {1:~ }│{1:~ }|*4
+ {3:[No Name] }{2:[No Name] }|
+ |
+ ]])
+end)
diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim
@@ -2263,6 +2263,7 @@ endfunc
func Test_winfixsize_vsep_statusline()
CheckScreendump
+
let lines =<< trim END
set noequalalways splitbelow splitright
vsplit
@@ -2307,4 +2308,22 @@ func Test_winfixsize_vsep_statusline()
call StopVimInTerminal(buf)
endfunc
+func Test_resize_from_another_tabpage()
+ CheckScreendump
+
+ let lines =<< trim END
+ set laststatus=2
+ vnew
+ let w = win_getid()
+ tabnew
+ call win_execute(w, 'vertical resize 20')
+ tabprev
+ END
+ call writefile(lines, 'XTestResizeFromAnotherTabpage', 'D')
+ let buf = RunVimInTerminal('-S XTestResizeFromAnotherTabpage', #{rows: 8})
+ call VerifyScreenDump(buf, 'Test_resize_from_another_tabpage_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab