patch 8.2.3687: blockwise insert does not handle autoindent properly
Problem: Blockwise insert does not handle autoindent properly when tab is
inserted.
Solution: Adjust text column for indent before computing column.
(closes #9229)
diff --git a/src/testdir/test_blockedit.vim b/src/testdir/test_blockedit.vim
index 216238a..e95520f 100644
--- a/src/testdir/test_blockedit.vim
+++ b/src/testdir/test_blockedit.vim
@@ -37,6 +37,31 @@
END
call assert_equal(expected, getline(1, 5))
+ " insert on the next column should do exactly the same
+ :%dele
+ call setline(1, lines)
+ exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>"
+ call assert_equal(expected, getline(1, 5))
+
+ :%dele
+ call setline(1, lines)
+ setlocal sw=8 noet
+ exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>"
+ let expected =<< trim END
+ var d = {
+ a: (): asdf => 0,
+ b: (): asdf => 0,
+ c: (): asdf => 0,
+ }
+ END
+ call assert_equal(expected, getline(1, 5))
+
+ " insert on the next column should do exactly the same
+ :%dele
+ call setline(1, lines)
+ exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>"
+ call assert_equal(expected, getline(1, 5))
+
filetype off
bwipe!
endfunc