summaryrefslogtreecommitdiff
path: root/src/testdir/test_mksession.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-26 20:07:38 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-26 20:07:38 +0100
commitd39e275b57493f9e25e1b62f84810571eee30cf4 (patch)
tree5b0b3dd06e22346bc2108a95ffeed31e00dc8472 /src/testdir/test_mksession.vim
parent6aba96dd5778b4201c9f5cb065d7669d3398e724 (diff)
downloadvim-git-d39e275b57493f9e25e1b62f84810571eee30cf4.tar.gz
patch 8.1.0829: when 'hidden' is set session creates extra buffersv8.1.0829
Problem: When 'hidden' is set session creates extra buffers. Solution: Move :badd commands to the end. (Jason Franklin)
Diffstat (limited to 'src/testdir/test_mksession.vim')
-rw-r--r--src/testdir/test_mksession.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim
index 3698976ca..303842201 100644
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -225,6 +225,29 @@ func Test_mksession_blank_tabs()
call delete('Xtest_mks.out')
endfunc
+func Test_mksession_buffer_count()
+ set hidden
+
+ " Edit exactly three files in the current session.
+ %bwipe!
+ e Xfoo | tabe Xbar | tabe Xbaz
+ tabdo write
+ mksession! Xtest_mks.out
+
+ " Verify that loading the session does not create additional buffers.
+ %bwipe!
+ source Xtest_mks.out
+ call assert_equal(3, len(getbufinfo()))
+
+ " Clean up.
+ call delete('Xfoo')
+ call delete('Xbar')
+ call delete('Xbaz')
+ call delete('Xtest_mks.out')
+ %bwipe!
+ set hidden&
+endfunc
+
if has('extra_search')
func Test_mksession_hlsearch()