diff options
author | glepnir <glephunter@gmail.com> | 2023-09-07 18:42:38 +0800 |
---|---|---|
committer | glepnir <glephunter@gmail.com> | 2023-09-09 17:15:58 +0800 |
commit | 8afb3a49c0762eb60368aee0314e6de261daa6ef (patch) | |
tree | bc954a00873a049f5a3a93cd532f3185d2f8cc38 /test/functional/api/highlight_spec.lua | |
parent | 82150ca51bf396e5795b49f6e1cb2faaaa07b28b (diff) | |
download | rneovim-8afb3a49c0762eb60368aee0314e6de261daa6ef.tar.gz rneovim-8afb3a49c0762eb60368aee0314e6de261daa6ef.tar.bz2 rneovim-8afb3a49c0762eb60368aee0314e6de261daa6ef.zip |
fix(highlight): add create param in nvim_get_hl
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 5fa2235018..492fd73223 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -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' }) |