aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-09-09 13:01:40 +0200
committerGitHub <noreply@github.com>2023-09-09 13:01:40 +0200
commitd4e80a051e54a60eae05880c6aa89d8abde6e935 (patch)
tree3bca87adfa14d9957a049c1f0f2f16e59c9c574b /test/functional/api/highlight_spec.lua
parent420b94eeece989a72b8891110f7d272f50eb0a1e (diff)
parent8afb3a49c0762eb60368aee0314e6de261daa6ef (diff)
downloadrneovim-d4e80a051e54a60eae05880c6aa89d8abde6e935.tar.gz
rneovim-d4e80a051e54a60eae05880c6aa89d8abde6e935.tar.bz2
rneovim-d4e80a051e54a60eae05880c6aa89d8abde6e935.zip
Merge pull request #25039 from glepnir/fix_hl
fix(highlight): add create param in nvim_get_hl api function
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua9
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' })