diff options
author | James McCoy <jamessan@jamessan.com> | 2017-09-26 15:52:21 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-09-26 16:03:43 -0400 |
commit | 25d4cd7e2830265505b0f6f88e6d08b4954af6eb (patch) | |
tree | bf2ba2eba676036c95e9f32e57a7bc60c13a2fb9 /src/nvim/testdir | |
parent | 43da7ea27b3391a9e74c658b90a5ed1cae926d40 (diff) | |
download | rneovim-25d4cd7e2830265505b0f6f88e6d08b4954af6eb.tar.gz rneovim-25d4cd7e2830265505b0f6f88e6d08b4954af6eb.tar.bz2 rneovim-25d4cd7e2830265505b0f6f88e6d08b4954af6eb.zip |
vim-patch:8.0.1024
Problem: Manual folds are lost when a session file has the same buffer in
two windows. (Jeansen)
Solution: Use ":edit" only once. (Christian Brabandt, closes vim/vim#1958)
https://github.com/vim/vim/commit/4bebc9a0565670b853d227f81a9a31eafdb47eed
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_mksession.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 7158b31a14..13fb07c7e0 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -121,4 +121,36 @@ func Test_mksession_arglist() argdel * endfunc + +func Test_mksession_one_buffer_two_windows() + edit Xtest1 + new Xtest2 + split + mksession! Xtest_mks.out + let lines = readfile('Xtest_mks.out') + let count1 = 0 + let count2 = 0 + let count2buf = 0 + for line in lines + if line =~ 'edit \f*Xtest1$' + let count1 += 1 + endif + if line =~ 'edit \f\{-}Xtest2' + let count2 += 1 + endif + if line =~ 'buffer \f\{-}Xtest2' + let count2buf += 1 + endif + endfor + call assert_equal(1, count1, 'Xtest1 count') + call assert_equal(2, count2, 'Xtest2 count') + call assert_equal(2, count2buf, 'Xtest2 buffer count') + + close + bwipe! + !cp Xtest_mks.out /tmp + call delete('Xtest_mks.out') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |