diff options
author | Christian Clason <c.clason@uni-graz.at> | 2021-11-28 11:47:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-28 11:47:07 +0100 |
commit | 1840c82b428e3bf425435309eafe24c4d56f248b (patch) | |
tree | 871730ca60b8f4d41f6293941af2e6446c891805 /src/nvim/testdir | |
parent | 07223fae54b5b8095da16c598fc1395ec3677691 (diff) | |
parent | 2f8ed7b822e112ed261fb5d100812fcb1c7a7d50 (diff) | |
download | rneovim-1840c82b428e3bf425435309eafe24c4d56f248b.tar.gz rneovim-1840c82b428e3bf425435309eafe24c4d56f248b.tar.bz2 rneovim-1840c82b428e3bf425435309eafe24c4d56f248b.zip |
Merge pull request #16451 from clason/vim-8.2.3684
vim-patch:8.2.{3684,3687}: blockwise insert does not handle autoindent properly
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_blockedit.vim | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_blockedit.vim b/src/nvim/testdir/test_blockedit.vim index 180524cd73..38978ef689 100644 --- a/src/nvim/testdir/test_blockedit.vim +++ b/src/nvim/testdir/test_blockedit.vim @@ -15,6 +15,58 @@ func Test_blockinsert_indent() bwipe! endfunc +func Test_blockinsert_autoindent() + new + let lines =<< trim END + var d = { + a: () => 0, + b: () => 0, + c: () => 0, + } + END + call setline(1, lines) + filetype plugin indent on + setlocal sw=2 et ft=vim + setlocal indentkeys+=: + 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)) + + :%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 + func Test_blockinsert_delete() new let _bs = &bs |