Commit: patch 9.2.0756: Session with multiple tabpages sets 'winminheight' to 0

0 views
Skip to first unread message

Christian Brabandt

unread,
2:45 PM (5 hours ago) 2:45 PM
to vim...@googlegroups.com
patch 9.2.0756: Session with multiple tabpages sets 'winminheight' to 0

Commit: https://github.com/vim/vim/commit/294dec827d5d6c183867bbea2971a407b297be80
Author: zeertzjq <zeer...@outlook.com>
Date: Tue Jun 30 18:34:12 2026 +0000

patch 9.2.0756: Session with multiple tabpages sets 'winminheight' to 0

Problem: Session with multiple tabpages sets 'winminheight' to 0.
Solution: Only save 'winminheight' and 'winminwidth' once (zeertzjq).

related: #8119
related: neovim/neovim#40493
closes: #20673

Signed-off-by: zeertzjq <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/session.c b/src/session.c
index 0fa03e556..7c1832192 100644
--- a/src/session.c
+++ b/src/session.c
@@ -889,9 +889,11 @@ makeopens(
// cursor can be set. This is done again below.
// winminheight and winminwidth need to be set to avoid an error if
// the user has set winheight or winwidth.
- if (put_line(fd, "save_winminheight = &winminheight") == FAIL
- || put_line(fd, "save_winminwidth = &winminwidth")
- == FAIL)
+ if (!restore_height_width
+ && (put_line(fd, "save_winminheight = &winminheight")
+ == FAIL
+ || put_line(fd, "save_winminwidth = &winminwidth")
+ == FAIL))
goto fail;
if (put_line(fd, "set winminheight=0") == FAIL
|| put_line(fd, "set winheight=1") == FAIL
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim
index b63f0edfc..958c11801 100644
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -1074,9 +1074,19 @@ func Test_mksession_winminheight()
endif
endfor
call assert_equal(2, found_restore)
+ " Test with multiple tabpages
+ tab split | split | tab split | split
+ call assert_equal(3, tabpagenr('$'))
+ mksession! Xtest_mks.out
+ tabclose | tabclose | close
+ call assert_equal(1, tabpagenr('$'))
+ set winminheight=2 winminwidth=2
+ source Xtest_mks.out
+ call assert_equal(3, tabpagenr('$'))
+ call assert_equal([2, 2], [&winminheight, &winminwidth])
+ tabclose | tabclose | close
call delete('Xtest_mks.out')
- close
- set sessionoptions&
+ set sessionoptions& winminheight& winminwidth&
endfunc

" Test for mksession with and without options restores shortmess
diff --git a/src/version.c b/src/version.c
index 3ce9aee7e..6aa1d99a6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 756,
/**/
755,
/**/
Reply all
Reply to author
Forward
0 new messages