diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-04 22:26:28 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-04 22:26:28 +0200 |
commit | 26d4b896a789e65df7ee0cf3e25056eabc523fda (patch) | |
tree | f1c170785d43bf5e41c4666ad83aa88a73e7f3ac /src/testdir/test_mksession.vim | |
parent | 92959fa46d305ded1da433ad6d9a8d38db240c74 (diff) | |
download | vim-git-26d4b896a789e65df7ee0cf3e25056eabc523fda.tar.gz |
patch 8.1.0149: session is wrong with multiple tabs when :lcd was usedv8.1.0149
Problem: The generated sessions file does not restore tabs properly if :lcd
was used in one of them.
Solution: Create the tab pages before setting the directory. (Yee Cheng
Chin, closes #3152)
Diffstat (limited to 'src/testdir/test_mksession.vim')
-rw-r--r-- | src/testdir/test_mksession.vim | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index e81d9b3e3..49d89ecc9 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -162,6 +162,53 @@ func Test_mksession_one_buffer_two_windows() call delete('Xtest_mks.out') endfunc +func Test_mksession_lcd_multiple_tabs() + tabnew + tabnew + lcd + tabfirst + lcd + mksession! Xtest_mks.out + tabonly + source Xtest_mks.out + call assert_true(haslocaldir(), 'Tab 1 localdir') + tabnext 2 + call assert_true(!haslocaldir(), 'Tab 2 localdir') + tabnext 3 + call assert_true(haslocaldir(), 'Tab 3 localdir') + call delete('Xtest_mks.out') +endfunc + +func Test_mksession_blank_tabs() + tabnew + tabnew + tabnew + tabnext 3 + mksession! Xtest_mks.out + tabnew + tabnew + tabnext 2 + source Xtest_mks.out + call assert_equal(4, tabpagenr('$'), 'session restore should restore number of tabs') + call assert_equal(3, tabpagenr(), 'session restore should restore the active tab') + call delete('Xtest_mks.out') +endfunc + +func Test_mksession_blank_windows() + split + split + split + 3 wincmd w + mksession! Xtest_mks.out + split + split + 2 wincmd w + source Xtest_mks.out + call assert_equal(4, winnr('$'), 'session restore should restore number of windows') + call assert_equal(3, winnr(), 'session restore should restore the active window') + call delete('Xtest_mks.out') +endfunc + if has('terminal') func Test_mksession_terminal_shell() |