aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-07-12 01:37:04 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-07-17 16:12:49 +0100
commit96a6b9b52d93732fc39664e202470a65da6012b3 (patch)
treeb725ee50694ce112696870d641065742dd2e870f /src/nvim/testdir
parent5377b2b00aea1a0bde1b81452e6198dabe5b9796 (diff)
downloadrneovim-96a6b9b52d93732fc39664e202470a65da6012b3.tar.gz
rneovim-96a6b9b52d93732fc39664e202470a65da6012b3.tar.bz2
rneovim-96a6b9b52d93732fc39664e202470a65da6012b3.zip
vim-patch:8.1.0829: when 'hidden' is set session creates extra buffers
Problem: When 'hidden' is set session creates extra buffers. Solution: Move :badd commands to the end. (Jason Franklin) https://github.com/vim/vim/commit/d39e275b57493f9e25e1b62f84810571eee30cf4 Adjust some tests in ex_cmds/mksession_spec.lua: - 'restores same :terminal buf in splits': Buffers aren't always :badded in the same order as they're :edited, :balted, etc, so the order of buffers in the buffer list may change slightly now that :badd happens afterwards. - 'restores buffers with tab-local CWD': This is explained in a comment.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_mksession.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim
index 4026f2bf98..fbe764bbf2 100644
--- a/src/nvim/testdir/test_mksession.vim
+++ b/src/nvim/testdir/test_mksession.vim
@@ -287,6 +287,29 @@ func Test_mksession_blank_windows()
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()