diff options
author | glepnir <glephunter@gmail.com> | 2023-09-18 14:50:27 +0800 |
---|---|---|
committer | glepnir <glephunter@gmail.com> | 2023-09-26 19:41:23 +0800 |
commit | f8ea49cfe1f4f3ed30da160d346553f0949ec1de (patch) | |
tree | f6ce262e040b6bdd5f47ae9e3a470933f546f324 /test/functional/api/highlight_spec.lua | |
parent | 71530cc972576e6656431b6d000aec9b69a0997e (diff) | |
download | rneovim-f8ea49cfe1f4f3ed30da160d346553f0949ec1de.tar.gz rneovim-f8ea49cfe1f4f3ed30da160d346553f0949ec1de.tar.bz2 rneovim-f8ea49cfe1f4f3ed30da160d346553f0949ec1de.zip |
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) |