summaryrefslogtreecommitdiff
path: root/src/testdir/test_fold.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-19 22:48:30 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-19 22:48:30 +0200
commit9a4a8c4d5993c6371486c895a515c2ad351e9aaa (patch)
tree8edb7b29042b5c89c345c5df3220f715eeecf39b /src/testdir/test_fold.vim
parentea7ecfe2a08877f98edec9b9c26b9e1b3673f00b (diff)
downloadvim-git-9a4a8c4d5993c6371486c895a515c2ad351e9aaa.tar.gz
patch 8.1.1890: ml_get error when deleting fold markerv8.1.1890
Problem: Ml_get error when deleting fold marker. Solution: Check that the line number is not below the last line. Adjust the fold when deleting the empty line. (Christian Brabandt, closes #4834)
Diffstat (limited to 'src/testdir/test_fold.vim')
-rw-r--r--src/testdir/test_fold.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim
index dc5879516..1d5259f6b 100644
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
@@ -741,3 +741,19 @@ func Test_folds_marker_in_comment2()
set foldmethod&
bwipe!
endfunc
+
+func Test_fold_delete_with_marker()
+ new
+ call setline(1, ['func Func() {{{1', 'endfunc'])
+ 1,2yank
+ new
+ set fdm=marker
+ call setline(1, 'x')
+ normal! Vp
+ normal! zd
+ call assert_equal(['func Func() ', 'endfunc'], getline(1, '$'))
+
+ set fdm&
+ bwipe!
+ bwipe!
+endfunc