mirror of
https://github.com/neovim/neovim.git
synced 2026-08-01 05:09:08 +00:00
vim-patch:9.2.0756: Session with multiple tabpages sets 'winminheight' to 0 (#40512)
Problem: Session with multiple tabpages sets 'winminheight' to 0. Solution: Only save 'winminheight' and 'winminwidth' once (zeertzjq). related: vim/vim#8119 related: neovim/neovim#40493 closes: vim/vim#20673294dec827d(cherry picked from commitc040f53dc1)
This commit is contained in:
committed by
github-actions[bot]
parent
822d96969b
commit
71343dad79
@@ -805,8 +805,10 @@ static int makeopens(FILE *fd, char *dirnow)
|
||||
// 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.
|
||||
PUTLINE_FAIL("let s:save_winminheight = &winminheight");
|
||||
PUTLINE_FAIL("let s:save_winminwidth = &winminwidth");
|
||||
if (!restore_height_width) {
|
||||
PUTLINE_FAIL("let s:save_winminheight = &winminheight");
|
||||
PUTLINE_FAIL("let s:save_winminwidth = &winminwidth");
|
||||
}
|
||||
if (fprintf(fd,
|
||||
"set winminheight=0\n"
|
||||
"set winheight=1\n"
|
||||
|
||||
@@ -1007,9 +1007,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
|
||||
|
||||
Reference in New Issue
Block a user