aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index 65b13bebf7..a4bd574a56 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -561,4 +561,18 @@ describe('API: get highlight', function()
eq({ link = 'String' }, meths.get_hl(0, { name = '@string' }))
eq({ fg = 10937249 }, meths.get_hl(0, { name = '@string.cpp', link = false }))
end)
+
+ it('can get all attributes for a linked group', function()
+ command('hi Bar guifg=red')
+ command('hi Foo guifg=#00ff00 gui=bold,underline')
+ command('hi! link Foo Bar')
+ eq({ link = 'Bar', fg = tonumber('00ff00', 16), bold = true, underline = true }, meths.get_hl(0, { name = 'Foo', link = true }))
+ end)
+
+ it('can set link as well as other attributes', function()
+ command('hi Bar guifg=red')
+ local hl = { link = 'Bar', fg = tonumber('00ff00', 16), bold = true, cterm = { bold = true } }
+ meths.set_hl(0, 'Foo', hl)
+ eq(hl, meths.get_hl(0, { name = 'Foo', link = true }))
+ end)
end)