From 8db55aedb52883f4b024ddd05524e18bc93d5c0b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 23 Apr 2022 06:55:24 +0800 Subject: vim-patch:8.2.4805: CurSearch used for all matches in current line Problem: CurSearch used for all matches in current line. Solution: Don't use the non-zero line count. (closes vim/vim#10247) https://github.com/vim/vim/commit/9b36750640e8e89f18afa1446ed80fdbdf0fcac0 --- src/nvim/testdir/test_search.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 24ecc58281..d359e69f91 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -951,7 +951,7 @@ func Test_hlsearch_cursearch() let lines =<< trim END set hlsearch scrolloff=0 - call setline(1, ['one', 'foo', 'bar', 'baz', 'foo', 'bar']) + call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar']) hi Search ctermbg=yellow hi CurSearch ctermbg=blue END @@ -964,7 +964,14 @@ func Test_hlsearch_cursearch() call term_sendkeys(buf, "n") call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2', {}) - call term_sendkeys(buf, "?\") + call term_sendkeys(buf, "n") + call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2a', {}) + + call term_sendkeys(buf, "n") + call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2b', {}) + + call term_sendkeys(buf, ":call setline(5, 'foo')\") + call term_sendkeys(buf, "0?\") call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_3', {}) call term_sendkeys(buf, "gg/foo\\nbar\") -- cgit