Mercurial > vim
diff src/testdir/test_mksession.vim @ 12289:294f510f6d35 v8.0.1024
patch 8.0.1024: folds lost when session file has a buffer in two windows
commit https://github.com/vim/vim/commit/4bebc9a0565670b853d227f81a9a31eafdb47eed
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 30 21:07:38 2017 +0200
patch 8.0.1024: folds lost when session file has a buffer in two windows
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 #1958)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 30 Aug 2017 21:15:04 +0200 |
parents | 3adae5c1b1cd |
children | c3548d947646 |
line wrap: on
line diff
--- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -121,5 +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