aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/fold_spec.lua
diff options
context:
space:
mode:
authorBrandon Simmons <34775764+simmsbra@users.noreply.github.com>2023-04-06 11:08:46 -0500
committerGitHub <noreply@github.com>2023-04-07 00:08:46 +0800
commit824639c7c17c4870cde83dd28fed7ed6be0ed4c9 (patch)
tree9e1da86556e8215c7f90841458cc8947e6c66a0d /test/functional/editor/fold_spec.lua
parentdd80ee0ca948bb548a8af804523ea7ea29c18279 (diff)
downloadrneovim-824639c7c17c4870cde83dd28fed7ed6be0ed4c9.tar.gz
rneovim-824639c7c17c4870cde83dd28fed7ed6be0ed4c9.tar.bz2
rneovim-824639c7c17c4870cde83dd28fed7ed6be0ed4c9.zip
fix(folds): handle visual blockwise indent insertion correctly (#22898)
Previously, the fold information was incorrect because it wasn't being updated during the blockwise insertion. (Solution by zeertzjq)
Diffstat (limited to 'test/functional/editor/fold_spec.lua')
-rw-r--r--test/functional/editor/fold_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/editor/fold_spec.lua b/test/functional/editor/fold_spec.lua
index 00e83bedc8..01a30f87bf 100644
--- a/test/functional/editor/fold_spec.lua
+++ b/test/functional/editor/fold_spec.lua
@@ -359,4 +359,14 @@ a]], '13m7')
eq(10, funcs.foldclosedend(7))
eq(14, funcs.foldclosedend(11))
end)
+ it('updates correctly with indent method and visual blockwise insertion', function()
+ insert([[
+ a
+ b
+ ]])
+ feed_command('set foldmethod=indent', 'set shiftwidth=2')
+ feed('gg0<C-v>jI <Esc>') -- indent both lines using visual blockwise mode
+ eq(1, funcs.foldlevel(1))
+ eq(1, funcs.foldlevel(2))
+ end)
end)