diff options
-rw-r--r-- | src/nvim/ops.c | 4 | ||||
-rw-r--r-- | test/functional/editor/fold_spec.lua | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index d2e9fda7d9..c6564e427e 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -623,9 +623,9 @@ static void block_insert(oparg_T *oap, char *s, int b_insert, struct block_def * } } // for all lnum - changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L, true); - State = oldstate; + + changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L, true); } /// Handle reindenting a block of lines. 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) |