mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 01:09:56 +10:00
vim-patch:8.2.5047: CurSearch highlight is often wrong
Problem: CurSearch highlight is often wrong.
Solution: Remember the last highlighted position and redraw when needed.
368137aa52
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -197,7 +197,8 @@ describe('search highlighting', function()
|
||||
}
|
||||
end)
|
||||
|
||||
it('works for multiline match', function()
|
||||
-- oldtest: Test_hlsearch_cursearch()
|
||||
it('works for multiline match, no duplicate highlight', function()
|
||||
command([[call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])]])
|
||||
feed('gg/foo<CR>')
|
||||
screen:expect([[
|
||||
@@ -281,6 +282,28 @@ describe('search highlighting', function()
|
||||
{2:hij}kl |
|
||||
/efg\nhij |
|
||||
]])
|
||||
|
||||
-- check clearing CurSearch when using it for another match
|
||||
feed('G?^abcd<CR>Y')
|
||||
screen:expect([[
|
||||
--- |
|
||||
{1:abcd}efg |
|
||||
hijkl |
|
||||
--- |
|
||||
{2:^abcd}efg |
|
||||
hijkl |
|
||||
?^abcd |
|
||||
]])
|
||||
feed('kkP')
|
||||
screen:expect([[
|
||||
--- |
|
||||
{1:abcd}efg |
|
||||
{2:^abcd}efg |
|
||||
hijkl |
|
||||
--- |
|
||||
{1:abcd}efg |
|
||||
?^abcd |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
@@ -1094,6 +1094,11 @@ func Test_hlsearch_cursearch()
|
||||
call term_sendkeys(buf, "h\<C-L>")
|
||||
call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_multiple_line_5', {})
|
||||
|
||||
" check clearing CurSearch when using it for another match
|
||||
call term_sendkeys(buf, "G?^abcd\<CR>Y")
|
||||
call term_sendkeys(buf, "kkP")
|
||||
call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_changed_1', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xhlsearch_cursearch')
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user