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)
9b36750640
This commit is contained in:
zeertzjq
2022-04-23 06:55:24 +08:00
parent 4e4914ab2e
commit 8db55aedb5
3 changed files with 59 additions and 16 deletions

View File

@@ -163,14 +163,14 @@ 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<CR>')
screen:expect([[
one |
{2:^foo} |
bar |
baz |
{1:foo} |
{1:foo} the {1:foo} and {1:foo} |
bar |
/foo |
]])
@@ -180,11 +180,32 @@ describe('search highlighting', function()
{1:foo} |
bar |
baz |
{2:^foo} |
{2:^foo} the {1:foo} and {1:foo} |
bar |
/foo |
]])
feed('?<CR>')
feed('n')
screen:expect([[
one |
{1:foo} |
bar |
baz |
{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 |
]])
command([[call setline(5, 'foo')]])
feed('0?<CR>')
screen:expect([[
one |
{2:^foo} |