mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 01:09:56 +10:00
fix(highlight): make CurSearch work properly with 'winhl' (#24448)
This commit is contained in:
@@ -56,7 +56,7 @@ describe('search highlighting', function()
|
||||
}}
|
||||
end)
|
||||
|
||||
it('works', function()
|
||||
local function test_search_hl()
|
||||
insert([[
|
||||
some text
|
||||
more textstuff
|
||||
@@ -109,6 +109,26 @@ describe('search highlighting', function()
|
||||
{1:~ }|
|
||||
:nohlsearch |
|
||||
]])
|
||||
end
|
||||
|
||||
it("works when 'winhighlight' is not set", function()
|
||||
test_search_hl()
|
||||
end)
|
||||
|
||||
it("works when 'winhighlight' doesn't change Search highlight", function()
|
||||
command('setlocal winhl=NonText:Underlined')
|
||||
local attrs = screen:get_default_attr_ids()
|
||||
attrs[1] = {foreground = Screen.colors.SlateBlue, underline = true}
|
||||
screen:set_default_attr_ids(attrs)
|
||||
test_search_hl()
|
||||
end)
|
||||
|
||||
it("works when 'winhighlight' changes Search highlight", function()
|
||||
command('setlocal winhl=Search:Underlined')
|
||||
local attrs = screen:get_default_attr_ids()
|
||||
attrs[2] = {foreground = Screen.colors.SlateBlue, underline = true}
|
||||
screen:set_default_attr_ids(attrs)
|
||||
test_search_hl()
|
||||
end)
|
||||
|
||||
describe('CurSearch highlight', function()
|
||||
|
||||
Reference in New Issue
Block a user