mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(highlight): 'winhl' shouldn't take priority over API (#31288)
This commit is contained in:
@@ -710,4 +710,18 @@ describe('API: set/get highlight namespace', function()
|
||||
api.nvim_win_set_hl_ns(0, ns)
|
||||
eq(ns, api.nvim_get_hl_ns({ winid = 0 }))
|
||||
end)
|
||||
|
||||
it('setting namespace takes priority over &winhighlight', function()
|
||||
command('set winhighlight=Visual:Search')
|
||||
n.insert('foobar')
|
||||
local ns = api.nvim_create_namespace('')
|
||||
api.nvim_win_set_hl_ns(0, ns)
|
||||
eq(ns, api.nvim_get_hl_ns({ winid = 0 }))
|
||||
command('enew') -- switching buffer keeps namespace #30904
|
||||
eq(ns, api.nvim_get_hl_ns({ winid = 0 }))
|
||||
command('set winhighlight=')
|
||||
eq(ns, api.nvim_get_hl_ns({ winid = 0 }))
|
||||
command('set winhighlight=Visual:Search')
|
||||
eq(ns, api.nvim_get_hl_ns({ winid = 0 }))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user