diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-09-26 14:20:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-26 14:20:10 +0200 |
commit | fe95037cdb9b0294ca24dbd0ff82c8462d051307 (patch) | |
tree | ab7ad7fced1d29b5037bacc667bbaed6ece9b272 /test/functional/api/highlight_spec.lua | |
parent | 4db77017fb7ab9321817674a5f5533df4cd03f3f (diff) | |
parent | f8ea49cfe1f4f3ed30da160d346553f0949ec1de (diff) | |
download | rneovim-fe95037cdb9b0294ca24dbd0ff82c8462d051307.tar.gz rneovim-fe95037cdb9b0294ca24dbd0ff82c8462d051307.tar.bz2 rneovim-fe95037cdb9b0294ca24dbd0ff82c8462d051307.zip |
Merge pull request #25229 from glepnir/20323
fix(highlight): add force in nvim_set_hl
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 5d6aaa57e6..1a054741ef 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -625,4 +625,15 @@ describe('API: get highlight', function() eq('FooBarA xxx cterm=bold,italic guifg=#ffffff', exec_capture('highlight FooBarA')) end) + + it('can override exist highlight group by force #20323', function() + local white = tonumber('ffffff', 16) + local green = tonumber('00ff00', 16) + meths.set_hl(0, 'Foo', { fg=white }) + meths.set_hl(0, 'Foo', { fg=green, force = true }) + eq({ fg = green },meths.get_hl(0, {name = 'Foo'})) + meths.set_hl(0, 'Bar', {link = 'Comment', default = true}) + meths.set_hl(0, 'Bar', {link = 'Foo',default = true, force = true}) + eq({link ='Foo', default = true}, meths.get_hl(0, {name = 'Bar'})) + end) end) |