diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-27 22:47:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-27 22:47:43 +0000 |
commit | 59f4f9505ae7ca2499904b94100db103e5ada5a6 (patch) | |
tree | 6bbe5b8e14920ef063fb1784b796e351e74221cb /src/testdir/test_blockedit.vim | |
parent | 3d14c0f2b964195d08b34bb43f89ec5f99255194 (diff) |
patch 8.2.3687: blockwise insert does not handle autoindent properlyv8.2.3687
Problem: Blockwise insert does not handle autoindent properly when tab is
inserted.
Solution: Adjust text column for indent before computing column.
(closes #9229)
Diffstat (limited to 'src/testdir/test_blockedit.vim')
-rw-r--r-- | src/testdir/test_blockedit.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_blockedit.vim b/src/testdir/test_blockedit.vim index 216238a528..e95520ff00 100644 --- a/src/testdir/test_blockedit.vim +++ b/src/testdir/test_blockedit.vim @@ -37,6 +37,31 @@ func Test_blockinsert_autoindent() 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 |