diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-02-21 20:17:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 13:17:36 -0700 |
commit | 1e7cb2dcd975aadeb91b913f117b21c7775c3374 (patch) | |
tree | b3722c65ecf7062cdfd5d80df98c19fbf80d3c42 /test/functional/api/highlight_spec.lua | |
parent | fc7fc14bd2ab1090bd97d1836d3a472ad0ce4f97 (diff) | |
download | rneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.tar.gz rneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.tar.bz2 rneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.zip |
fix(highlight): accept NONE as a color name (#17487)
... for when `ns=0`.
Also update the documentation of nvim_set_hl to clarify the set
behaviour.
Fixes #17478
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 03b407f4e0..6924d41e0b 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -304,10 +304,6 @@ describe("API: set highlight", function() eq('Test_hl3 xxx ctermbg=9', exec_capture('highlight Test_hl3')) - meths.set_hl(0, 'Test_hl3', {}) - eq('Test_hl3 xxx cleared', - exec_capture('highlight Test_hl3')) - eq("'redd' is not a valid color", pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='redd'})) @@ -320,5 +316,12 @@ describe("API: set highlight", function() eq("'#FF00FF' is not a valid color", pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='#FF00FF'})) + + for _, fg_val in ipairs{ nil, 'NONE', 'nOnE', '', -1 } do + meths.set_hl(0, 'Test_hl3', {fg = fg_val}) + eq('Test_hl3 xxx cleared', + exec_capture('highlight Test_hl3')) + end + end) end) |