Mercurial > vim
diff src/testdir/test_fold.vim @ 17787:92e0996e1cb8 v8.1.1890
patch 8.1.1890: ml_get error when deleting fold marker
commit https://github.com/vim/vim/commit/9a4a8c4d5993c6371486c895a515c2ad351e9aaa
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 19 22:48:30 2019 +0200
patch 8.1.1890: ml_get error when deleting fold marker
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 19 Aug 2019 23:00:05 +0200 |
parents | 0da9bc55c31a |
children | 73ddc462979d |
line wrap: on
line diff
--- 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