aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorOliver Marriott <rktjmp@users.noreply.github.com>2022-06-17 11:33:58 +1000
committerGitHub <noreply@github.com>2022-06-16 18:33:58 -0700
commit98e2da7d50b8f22edb20cdb744788ef0085d0cb6 (patch)
tree457789efddd8ac41f3ab0c5791ace16f11da7031 /test/functional/api/highlight_spec.lua
parente0aa1d87e81ddf4efec96fad8365b3ea1aee1c26 (diff)
downloadrneovim-98e2da7d50b8f22edb20cdb744788ef0085d0cb6.tar.gz
rneovim-98e2da7d50b8f22edb20cdb744788ef0085d0cb6.tar.bz2
rneovim-98e2da7d50b8f22edb20cdb744788ef0085d0cb6.zip
fix(hl): return cterm fg/bg even if they match Normal #18981
Fixes #18980 - 831fa45ad84e is related but this doesn't regress that - The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally carried from patch to patch starting all the way back in 29bc6dfabde2 where it was avoiding setting a HL attr. But `hlattrs2dict()` now is just informational.
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index 785f72b3db..8235374f22 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -133,6 +133,13 @@ describe('API: highlight',function()
eq({ underline = true, standout = true, },
meths.get_hl_by_name('cursorline', 0));
+ -- Test cterm & Normal values. #18024 (tail) & #18980
+ -- Ensure Normal, and groups that match Normal return their fg & bg cterm values
+ meths.set_hl(0, 'Normal', {ctermfg = 17, ctermbg = 213})
+ meths.set_hl(0, 'NotNormal', {ctermfg = 17, ctermbg = 213})
+ -- Note colors are "cterm" values, not rgb-as-ints
+ eq({foreground = 17, background = 213}, nvim("get_hl_by_name", 'Normal', false))
+ eq({foreground = 17, background = 213}, nvim("get_hl_by_name", 'NotNormal', false))
end)
it('nvim_get_hl_id_by_name', function()