From e53330a603fc95b3b00af98bce56982627851641 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 17 Jul 2022 09:23:49 +0800 Subject: 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. --- src/nvim/testdir/test_visual.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/nvim/testdir/test_visual.vim') 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\", '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\", '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']) -- cgit