Skip to content

Commit bd3b958

Browse files
zeertzjqchrisbra
authored andcommitted
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]>
1 parent 3796c10 commit bd3b958

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
| +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
2+
> +0#0000000#ffffff0@19||+1&&| +0&&@53
3+
|~+0#4040ff13&| @18||+1#0000000&|~+0#4040ff13&| @52
4+
|~| @18||+1#0000000&|~+0#4040ff13&| @52
5+
|~| @18||+1#0000000&|~+0#4040ff13&| @52
6+
|~| @18||+1#0000000&|~+0#4040ff13&| @52
7+
|<+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
8+
| +0&&@74

src/testdir/test_window_cmd.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,6 +2307,7 @@ endfunc
23072307

23082308
func Test_winfixsize_vsep_statusline()
23092309
CheckScreendump
2310+
23102311
let lines =<< trim END
23112312
set noequalalways splitbelow splitright
23122313
vsplit
@@ -2351,4 +2352,22 @@ func Test_winfixsize_vsep_statusline()
23512352
call StopVimInTerminal(buf)
23522353
endfunc
23532354

2355+
func Test_resize_from_another_tabpage()
2356+
CheckScreendump
2357+
2358+
let lines =<< trim END
2359+
set laststatus=2
2360+
vnew
2361+
let w = win_getid()
2362+
tabnew
2363+
call win_execute(w, 'vertical resize 20')
2364+
tabprev
2365+
END
2366+
call writefile(lines, 'XTestResizeFromAnotherTabpage', 'D')
2367+
let buf = RunVimInTerminal('-S XTestResizeFromAnotherTabpage', #{rows: 8})
2368+
call VerifyScreenDump(buf, 'Test_resize_from_another_tabpage_1', {})
2369+
2370+
call StopVimInTerminal(buf)
2371+
endfunc
2372+
23542373
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ static char *(features[]) =
729729

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1839,
732734
/**/
733735
1838,
734736
/**/

src/window.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,7 +4992,7 @@ leave_tabpage(
49924992
tp->tp_prevwin = prevwin;
49934993
tp->tp_firstwin = firstwin;
49944994
tp->tp_lastwin = lastwin;
4995-
tp->tp_old_Rows = Rows;
4995+
tp->tp_old_Rows = ROWS_AVAIL;
49964996
if (tp->tp_old_Columns != -1)
49974997
{
49984998
tp->tp_old_Columns = topframe->fr_width;
@@ -5054,7 +5054,7 @@ enter_tabpage(
50545054
// The tabpage line may have appeared or disappeared, may need to resize
50555055
// the frames for that. When the Vim window was resized need to update
50565056
// frame sizes too.
5057-
if (curtab->tp_old_Rows != Rows || (old_off != firstwin->w_winrow
5057+
if (curtab->tp_old_Rows != ROWS_AVAIL || (old_off != firstwin->w_winrow
50585058
#ifdef FEAT_GUI_TABLINE
50595059
&& !gui_use_tabline()
50605060
#endif

0 commit comments

Comments
 (0)