aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_visual.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-17 11:30:32 +0800
committerGitHub <noreply@github.com>2022-07-17 11:30:32 +0800
commit53c398d8f44f1796c216402c953512eb57733529 (patch)
treea4abcbed4256058b40e4dc1badd2f06c22079abf /src/nvim/testdir/test_visual.vim
parent9f837a5dcf61e0b27778dd7127036e12d694d92c (diff)
parent7c3a87182d471649126c58d999d46abede6f60cd (diff)
downloadrneovim-53c398d8f44f1796c216402c953512eb57733529.tar.gz
rneovim-53c398d8f44f1796c216402c953512eb57733529.tar.bz2
rneovim-53c398d8f44f1796c216402c953512eb57733529.zip
Merge pull request #19402 from zeertzjq/vim-8.2.0655
vim-patch:8.2.{0655,1040}: not enough tests
Diffstat (limited to 'src/nvim/testdir/test_visual.vim')
-rw-r--r--src/nvim/testdir/test_visual.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index f77765d415..f9ac0e0884 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -1189,6 +1189,29 @@ func Test_AAA_start_visual_mode_with_count()
close!
endfunc
+" Test for visually selecting an inner block (iB)
+func Test_visual_inner_block()
+ new
+ call setline(1, ['one', '{', 'two', '{', 'three', '}', 'four', '}', 'five'])
+ call cursor(5, 1)
+ " visually select all the lines in the block and then execute iB
+ call feedkeys("ViB\<C-C>", 'xt')
+ call assert_equal([0, 5, 1, 0], getpos("'<"))
+ call assert_equal([0, 5, 6, 0], getpos("'>"))
+ " visually select two inner blocks
+ call feedkeys("ViBiB\<C-C>", 'xt')
+ call assert_equal([0, 3, 1, 0], getpos("'<"))
+ call assert_equal([0, 7, 5, 0], getpos("'>"))
+ " try to select non-existing inner block
+ call cursor(5, 1)
+ call assert_beeps('normal ViBiBiB')
+ " try to select a unclosed inner block
+ 8,9d
+ call cursor(5, 1)
+ call assert_beeps('normal ViBiB')
+ close!
+endfunc
+
func Test_visual_put_in_block()
new
call setline(1, ['xxxx', 'y∞yy', 'zzzz'])