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 --- test/functional/ui/searchhl_spec.lua | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua index 84dc3c59bb..56ff8a4101 100644 --- a/test/functional/ui/searchhl_spec.lua +++ b/test/functional/ui/searchhl_spec.lua @@ -163,15 +163,25 @@ describe('search highlighting', function() end) it('works for multiline match', function() - command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo', 'bar'])]]) + command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])]]) feed('gg/foo') screen:expect([[ one | {2:^foo} | bar | baz | + {1:foo} the {1:foo} and {1:foo} | + bar | + /foo | + ]]) + feed('n') + screen:expect([[ + one | {1:foo} | bar | + baz | + {2:^foo} the {1:foo} and {1:foo} | + bar | /foo | ]]) feed('n') @@ -180,11 +190,22 @@ describe('search highlighting', function() {1:foo} | bar | baz | - {2:^foo} | + {1:foo} the {2:^foo} and {1:foo} | + bar | + /foo | + ]]) + feed('n') + screen:expect([[ + one | + {1:foo} | + bar | + baz | + {1:foo} the {1:foo} and {2:^foo} | bar | /foo | ]]) - feed('?') + command([[call setline(5, 'foo')]]) + feed('0?') screen:expect([[ one | {2:^foo} | -- cgit