]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1839: Window may have wrong height if resized from another tabpage v9.1.1839
authorzeertzjq <zeertzjq@outlook.com>
Wed, 8 Oct 2025 16:26:04 +0000 (16:26 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 8 Oct 2025 16:26:04 +0000 (16:26 +0000)
Problem:  Window may have wrong height if resized from another tabpage.
Solution: Improve check for whether a tabline has been added (zeertzjq).

fixes: #18518
closes: #18519

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/dumps/Test_resize_from_another_tabpage_1.dump [new file with mode: 0644]
src/testdir/test_window_cmd.vim
src/version.c
src/window.c

diff --git a/src/testdir/dumps/Test_resize_from_another_tabpage_1.dump b/src/testdir/dumps/Test_resize_from_another_tabpage_1.dump
new file mode 100644 (file)
index 0000000..85f6275
--- /dev/null
@@ -0,0 +1,8 @@
+| +2&#ffffff0|2+2#e000e06&| +2#0000000&|[|N|o| |N|a|m|e|]| | +8#0000001#e0e0e08|[|N|o| |N|a|m|e|]| | +1#0000000#ffffff0@49|X+8#0000001#e0e0e08
+> +0#0000000#ffffff0@19||+1&&| +0&&@53
+|~+0#4040ff13&| @18||+1#0000000&|~+0#4040ff13&| @52
+|~| @18||+1#0000000&|~+0#4040ff13&| @52
+|~| @18||+1#0000000&|~+0#4040ff13&| @52
+|~| @18||+1#0000000&|~+0#4040ff13&| @52
+|<+3#0000000&|N|o| |N|a|m|e|]| |0|,|0|-|1| @1|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @26|0|,|0|-|1| @9|A|l@1
+| +0&&@74
index c00f60e394ac3d1a05698803e29e7cd3db610328..c19d39fbf7cca3c1cf3c04b6402f8e819645b424 100644 (file)
@@ -2307,6 +2307,7 @@ endfunc
 
 func Test_winfixsize_vsep_statusline()
   CheckScreendump
+
   let lines =<< trim END
     set noequalalways splitbelow splitright
     vsplit
@@ -2351,4 +2352,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
index 55fe9bc113cdf9a779da13d1494c7bc03aa0f89f..bc3c8d45844a7d1f4ca2195353968b68d36578ea 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1839,
 /**/
     1838,
 /**/
index e2a1eae29ea6ccf0e4343908543fc78776929536..9a16ad53482ebfb88c2d0651418662a4326d8d75 100644 (file)
@@ -4992,7 +4992,7 @@ leave_tabpage(
     tp->tp_prevwin = prevwin;
     tp->tp_firstwin = firstwin;
     tp->tp_lastwin = lastwin;
-    tp->tp_old_Rows = Rows;
+    tp->tp_old_Rows = ROWS_AVAIL;
     if (tp->tp_old_Columns != -1)
     {
        tp->tp_old_Columns = topframe->fr_width;
@@ -5054,7 +5054,7 @@ enter_tabpage(
     // The tabpage line may have appeared or disappeared, may need to resize
     // the frames for that.  When the Vim window was resized need to update
     // frame sizes too.
-    if (curtab->tp_old_Rows != Rows || (old_off != firstwin->w_winrow
+    if (curtab->tp_old_Rows != ROWS_AVAIL || (old_off != firstwin->w_winrow
 #ifdef FEAT_GUI_TABLINE
                            && !gui_use_tabline()
 #endif