aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_blockedit.vim
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2021-11-28 00:35:26 +0100
committerChristian Clason <c.clason@uni-graz.at>2021-11-28 00:47:14 +0100
commit2f8ed7b822e112ed261fb5d100812fcb1c7a7d50 (patch)
treef2e4669f79e6655c9aeb844539d6425963d6805c /src/nvim/testdir/test_blockedit.vim
parenta8dd1ea0118d3416135cb49df0992f2983ad6c44 (diff)
downloadrneovim-2f8ed7b822e112ed261fb5d100812fcb1c7a7d50.tar.gz
rneovim-2f8ed7b822e112ed261fb5d100812fcb1c7a7d50.tar.bz2
rneovim-2f8ed7b822e112ed261fb5d100812fcb1c7a7d50.zip
vim-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 vim/vim#9229) https://github.com/vim/vim/commit/59f4f9505ae7ca2499904b94100db103e5ada5a6
Diffstat (limited to 'src/nvim/testdir/test_blockedit.vim')
-rw-r--r--src/nvim/testdir/test_blockedit.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_blockedit.vim b/src/nvim/testdir/test_blockedit.vim
index 5a72bebaba..38978ef689 100644
--- a/src/nvim/testdir/test_blockedit.vim
+++ b/src/nvim/testdir/test_blockedit.vim
@@ -38,6 +38,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