From ec9b57cb6e6679b7f08001677fc523a5d0a2a819 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 19 Aug 2019 21:23:43 -0400 Subject: vim-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 vim/vim#4834) https://github.com/vim/vim/commit/9a4a8c4d5993c6371486c895a515c2ad351e9aaa --- src/nvim/testdir/test_fold.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir/test_fold.vim') diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim index df3d691d85..4036eae678 100644 --- a/src/nvim/testdir/test_fold.vim +++ b/src/nvim/testdir/test_fold.vim @@ -740,3 +740,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 -- cgit