From aa5adef969f5f1ffcc3867200211fa236b569ae3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 6 Jan 2022 09:29:13 +0800 Subject: vim-patch:8.2.4007: session does not restore help buffer properly Problem: Session does not restore help buffer properly when "options' is missing from 'sessionoptions'. Solution: Use a ":help" command to create the help window. (closes vim/vim#9475, closes vim/vim#9458, closes vim/vim#9472) https://github.com/vim/vim/commit/8e7d9db32b53ca2b1cb7570d2042860bcd1e943f --- src/nvim/testdir/test_mksession.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 057895047d..a87691abf9 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -696,6 +696,36 @@ func Test_mksession_foldopt() set sessionoptions& endfunc +" Test for mksession with "help" but not "options" in 'sessionoptions' +func Test_mksession_help_noopt() + set sessionoptions-=options + set sessionoptions+=help + help + let fname = expand('%') + mksession! Xtest_mks.out + bwipe + + source Xtest_mks.out + call assert_equal('help', &buftype) + call assert_equal('help', &filetype) + call assert_equal(fname, expand('%')) + call assert_false(&modifiable) + call assert_true(&readonly) + + helpclose + help index + let fname = expand('%') + mksession! Xtest_mks.out + bwipe + + source Xtest_mks.out + call assert_equal('help', &buftype) + call assert_equal(fname, expand('%')) + + call delete('Xtest_mks.out') + set sessionoptions& +endfunc + " Test for mksession with window position func Test_mksession_winpos() if !has('gui_running') -- cgit