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_gn.vim | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_gn.vim') diff --git a/src/nvim/testdir/test_gn.vim b/src/nvim/testdir/test_gn.vim index d09b25b0e7..c4a41a6742 100644 --- a/src/nvim/testdir/test_gn.vim +++ b/src/nvim/testdir/test_gn.vim @@ -154,8 +154,24 @@ func Test_gn_command() norm! gg0f2vf7gNd call assert_equal(['1678'], getline(1,'$')) sil! %d _ - set wrapscan&vim + + " Without 'wrapscan', in visual mode, running gn without a match should fail + " but the visual mode should be kept. + set nowrapscan + call setline('.', 'one two') + let @/ = 'one' + call assert_beeps('normal 0wvlgn') + exe "normal y" + call assert_equal('tw', @") + + " with exclusive selection, run gn and gN + set selection=exclusive + normal 0gny + call assert_equal('one', @") + normal 0wgNy + call assert_equal('one', @") + set selection& endfunc func Test_gN_repeat() -- cgit