diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-06 21:32:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-06 21:32:54 +0100 |
commit | 0c4dc88a637a5027209aa00226996af84e248636 (patch) | |
tree | 7935c3de02676ecab304e13573e55559879bc0fe /src/testdir/test_bufline.vim | |
parent | 4148be468f82eb4bf463be3610b00a132aee4186 (diff) | |
download | vim-git-0c4dc88a637a5027209aa00226996af84e248636.tar.gz |
patch 8.0.1274: setbufline() fails when using foldingv8.0.1274
Problem: setbufline() fails when using folding.
Solution: Set "curwin" if needed. (Ozaki Kiichi, closes #2293)
Diffstat (limited to 'src/testdir/test_bufline.vim')
-rw-r--r-- | src/testdir/test_bufline.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/testdir/test_bufline.vim b/src/testdir/test_bufline.vim index cc5c10e98..b886e9950 100644 --- a/src/testdir/test_bufline.vim +++ b/src/testdir/test_bufline.vim @@ -27,6 +27,32 @@ func Test_setbufline_getbufline() exe "bwipe! " . b endfunc +func Test_setbufline_getbufline_fold() + split Xtest + setlocal foldmethod=expr foldexpr=0 + let b = bufnr('%') + new + call assert_equal(0, setbufline(b, 1, ['foo', 'bar'])) + call assert_equal(['foo'], getbufline(b, 1)) + call assert_equal(['bar'], getbufline(b, 2)) + call assert_equal(['foo', 'bar'], getbufline(b, 1, 2)) + exe "bwipe!" b + bwipe! +endfunc + +func Test_setbufline_getbufline_fold_tab() + split Xtest + setlocal foldmethod=expr foldexpr=0 + let b = bufnr('%') + tab new + call assert_equal(0, setbufline(b, 1, ['foo', 'bar'])) + call assert_equal(['foo'], getbufline(b, 1)) + call assert_equal(['bar'], getbufline(b, 2)) + call assert_equal(['foo', 'bar'], getbufline(b, 1, 2)) + exe "bwipe!" b + bwipe! +endfunc + func Test_setline_startup() let cmd = GetVimCommand('Xscript') if cmd == '' |