aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-24 22:21:54 +0800
committerGitHub <noreply@github.com>2022-04-24 22:21:54 +0800
commit2caf5bbbc58fcc9830cd3f8a6110b66040c6e660 (patch)
treea26196c54dbb8825be3d6652db5e8ad94eca217c /src/nvim/testdir
parent843d9223a14c599fda1b2abf1e7072be738fb831 (diff)
parent2511f3e76d895a725c1a833233e831c856d05422 (diff)
downloadrneovim-2caf5bbbc58fcc9830cd3f8a6110b66040c6e660.tar.gz
rneovim-2caf5bbbc58fcc9830cd3f8a6110b66040c6e660.tar.bz2
rneovim-2caf5bbbc58fcc9830cd3f8a6110b66040c6e660.zip
Merge pull request #18243 from zeertzjq/vim-8.2.4808
vim-patch:8.2.{4808,4810,4813}: pasting text while indent folding may mess up folds
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_fold.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim
index 6da1b3d4a0..9f5ad53adb 100644
--- a/src/nvim/testdir/test_fold.vim
+++ b/src/nvim/testdir/test_fold.vim
@@ -881,4 +881,24 @@ func Test_fold_relative_move()
set fdm& sw& wrap& tw&
endfunc
+" Make sure a fold containing a nested fold is split correctly when using
+" foldmethod=indent
+func Test_fold_split()
+ new
+ let lines =<< trim END
+ line 1
+ line 2
+ line 3
+ line 4
+ line 5
+ END
+ call setline(1, lines)
+ setlocal sw=2
+ setlocal foldmethod=indent foldenable
+ call assert_equal([0, 1, 1, 2, 2], range(1, 5)->map('foldlevel(v:val)'))
+ call append(2, 'line 2.5')
+ call assert_equal([0, 1, 0, 1, 2, 2], range(1, 6)->map('foldlevel(v:val)'))
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab