feat(ui): allow to get the highlight namespace

This commit is contained in:
Daniel Steinberg
2023-07-18 17:02:45 -04:00
committed by bfredl
parent be463e7643
commit 2615ed879e
6 changed files with 70 additions and 0 deletions

View File

@@ -637,3 +637,19 @@ describe('API: get highlight', function()
eq({link ='Foo', default = true}, meths.get_hl(0, {name = 'Bar'}))
end)
end)
describe('API: set/get highlight namespace', function()
it('set/get highlight namespace', function()
eq(0, meths.get_hl_ns({}))
local ns = meths.create_namespace('')
meths.set_hl_ns(ns)
eq(ns, meths.get_hl_ns({}))
end)
it('set/get window highlight namespace', function()
eq(-1, meths.get_hl_ns({winid = 0}))
local ns = meths.create_namespace('')
meths.win_set_hl_ns(0, ns)
eq(ns, meths.get_hl_ns({winid = 0}))
end)
end)