patch 9.1.1839: Window may have wrong height if resized from another tabpage

Commit: 
https://github.com/vim/vim/commit/bd3b9580273e890951135686875de9bd49e798bc
Author: zeertzjq <[email protected]>
Date:   Wed Oct 8 16:26:04 2025 +0000

    patch 9.1.1839: Window may have wrong height if resized from another tabpage
    
    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

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
index 000000000..85f627520
--- /dev/null
+++ b/src/testdir/dumps/Test_resize_from_another_tabpage_1.dump
@@ -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
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index c00f60e39..c19d39fbf 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 55fe9bc11..bc3c8d458 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1839,
 /**/
     1838,
 /**/
diff --git a/src/window.c b/src/window.c
index e2a1eae29..9a16ad534 100644
--- a/src/window.c
+++ b/src/window.c
@@ -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

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v6X3O-002CwQ-Sc%40256bit.org.

Raspunde prin e-mail lui