aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/highlight_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-23 16:15:04 +0800
committerGitHub <noreply@github.com>2023-02-23 16:15:04 +0800
commit524e1a06432ed7a88c1e183d81812dd48dc18cfb (patch)
tree3964961f56feece9b1e306966fb9f17e166259f2 /test/functional/ex_cmds/highlight_spec.lua
parentd422fc8274e757e95329e60b4e6daec59363ba19 (diff)
downloadrneovim-524e1a06432ed7a88c1e183d81812dd48dc18cfb.tar.gz
rneovim-524e1a06432ed7a88c1e183d81812dd48dc18cfb.tar.bz2
rneovim-524e1a06432ed7a88c1e183d81812dd48dc18cfb.zip
fix(highlight): avoid ORing underline flags (#22372)
When combining attributes use the one that takes priority. For :highlight command use the last one specified. For API use a hard-coded order same as the order in docs.
Diffstat (limited to 'test/functional/ex_cmds/highlight_spec.lua')
-rw-r--r--test/functional/ex_cmds/highlight_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/highlight_spec.lua b/test/functional/ex_cmds/highlight_spec.lua
index 1cd6759a53..18f215cf75 100644
--- a/test/functional/ex_cmds/highlight_spec.lua
+++ b/test/functional/ex_cmds/highlight_spec.lua
@@ -36,4 +36,13 @@ describe(':highlight', function()
command('highlight normal ctermbg=red')
eq('9', eval('synIDattr(hlID("Normal"), "bg", "cterm")'))
end)
+
+ it('only the last underline style takes effect #22371', function()
+ command('highlight NonText gui=underline,undercurl')
+ eq('', eval('synIDattr(hlID("NonText"), "underline", "gui")'))
+ eq('1', eval('synIDattr(hlID("NonText"), "undercurl", "gui")'))
+ command('highlight NonText gui=undercurl,underline')
+ eq('', eval('synIDattr(hlID("NonText"), "undercurl", "gui")'))
+ eq('1', eval('synIDattr(hlID("NonText"), "underline", "gui")'))
+ end)
end)