From: zeertzjq Date: Tue, 30 Jun 2026 18:34:12 +0000 (+0000) Subject: patch 9.2.0756: Session with multiple tabpages sets 'winminheight' to 0 X-Git-Tag: v9.2.0756^0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=294dec827d5d6c183867bbea2971a407b297be80;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/session.c b/src/session.c index 0fa03e556d..7c18321926 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 b63f0edfc8..958c118015 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 3ce9aee7ed..6aa1d99a67 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, /**/