diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-17 09:23:49 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-17 10:03:58 +0800 |
| commit | e53330a603fc95b3b00af98bce56982627851641 (patch) | |
| tree | b3576fe524dadc5bcd0a14601c02437bd27a350e /src/nvim/testdir/test_visual.vim | |
| parent | 9f837a5dcf61e0b27778dd7127036e12d694d92c (diff) | |
| download | rneovim-e53330a603fc95b3b00af98bce56982627851641.tar.gz rneovim-e53330a603fc95b3b00af98bce56982627851641.tar.bz2 rneovim-e53330a603fc95b3b00af98bce56982627851641.zip | |
vim-patch:8.2.0655: search code not sufficiently tested
Problem: Search code not sufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5999)
https://github.com/vim/vim/commit/224a5f17c6ec9e98322a4c6792ce4f9bb31a4cce
Cherry-pick test_charsearch.vim change from patch 8.2.0448.
Cherry-pick test_search.vim changes from patch 8.2.0619.
Diffstat (limited to 'src/nvim/testdir/test_visual.vim')
| -rw-r--r-- | src/nvim/testdir/test_visual.vim | 23 |
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']) |