From aab8134f87227d166f726f114528057c77832ab0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 9 Oct 2025 07:49:05 +0800 Subject: [PATCH] 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 (cherry picked from commit 28355050a8781d9f8f22edd3f4448d4451450d41) --- test/functional/legacy/window_cmd_spec.lua | 24 ++++++++++++++++++++++ test/old/testdir/test_window_cmd.vim | 19 +++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index 6f71e17e97..d6120678a9 100644 --- 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 index 6439b9d4a3..a63ab430c7 100644 --- 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