mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(highlight): add force in nvim_set_hl
This commit is contained in:
@@ -625,4 +625,15 @@ describe('API: get highlight', function()
|
||||
eq('FooBarA xxx cterm=bold,italic guifg=#ffffff',
|
||||
exec_capture('highlight FooBarA'))
|
||||
end)
|
||||
|
||||
it('can override exist highlight group by force #20323', function()
|
||||
local white = tonumber('ffffff', 16)
|
||||
local green = tonumber('00ff00', 16)
|
||||
meths.set_hl(0, 'Foo', { fg=white })
|
||||
meths.set_hl(0, 'Foo', { fg=green, force = true })
|
||||
eq({ fg = green },meths.get_hl(0, {name = 'Foo'}))
|
||||
meths.set_hl(0, 'Bar', {link = 'Comment', default = true})
|
||||
meths.set_hl(0, 'Bar', {link = 'Foo',default = true, force = true})
|
||||
eq({link ='Foo', default = true}, meths.get_hl(0, {name = 'Bar'}))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user