mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 14:55:33 +00:00
fix(highlight): add create param in nvim_get_hl
This commit is contained in:
@@ -439,6 +439,15 @@ describe('API: get highlight', function()
|
||||
eq('Highlight id out of bounds', pcall_err(meths.get_hl, 0, { name = 'Test set hl' }))
|
||||
end)
|
||||
|
||||
it('nvim_get_hl with create flag', function()
|
||||
eq({}, nvim("get_hl", 0, {name = 'Foo', create = false}))
|
||||
eq(0, funcs.hlexists('Foo'))
|
||||
meths.get_hl(0, {name = 'Bar', create = true})
|
||||
eq(1, funcs.hlexists('Bar'))
|
||||
meths.get_hl(0, {name = 'FooBar'})
|
||||
eq(1, funcs.hlexists('FooBar'))
|
||||
end)
|
||||
|
||||
it('can get all highlights in current namespace', function()
|
||||
local ns = get_ns()
|
||||
meths.set_hl(ns, 'Test_hl', { bg = '#B4BEFE' })
|
||||
|
||||
Reference in New Issue
Block a user