From 524e1a06432ed7a88c1e183d81812dd48dc18cfb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 23 Feb 2023 16:15:04 +0800 Subject: 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. --- test/functional/ex_cmds/highlight_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/ex_cmds/highlight_spec.lua') 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) -- cgit From 4ce0ada0d4c8c57a181ab08717a3d052d46ae158 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 8 Apr 2023 16:57:47 +0800 Subject: fix(highlight): add missing g: prefix for colors_name (#22952) Fix #22951. This was fixed in Vim in patch 8.2.0613. --- test/functional/ex_cmds/highlight_spec.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/functional/ex_cmds/highlight_spec.lua') diff --git a/test/functional/ex_cmds/highlight_spec.lua b/test/functional/ex_cmds/highlight_spec.lua index 18f215cf75..45764e6719 100644 --- a/test/functional/ex_cmds/highlight_spec.lua +++ b/test/functional/ex_cmds/highlight_spec.lua @@ -3,6 +3,9 @@ local helpers = require("test.functional.helpers")(after_each) local eq, command = helpers.eq, helpers.command local clear = helpers.clear local eval, exc_exec = helpers.eval, helpers.exc_exec +local exec = helpers.exec +local funcs = helpers.funcs +local meths = helpers.meths describe(':highlight', function() local screen @@ -45,4 +48,20 @@ describe(':highlight', function() eq('', eval('synIDattr(hlID("NonText"), "undercurl", "gui")')) eq('1', eval('synIDattr(hlID("NonText"), "underline", "gui")')) end) + + it('clear', function() + meths.set_var('colors_name', 'foo') + eq(1, funcs.exists('g:colors_name')) + command('hi clear') + eq(0, funcs.exists('g:colors_name')) + meths.set_var('colors_name', 'foo') + eq(1, funcs.exists('g:colors_name')) + exec([[ + func HiClear() + hi clear + endfunc + ]]) + funcs.HiClear() + eq(0, funcs.exists('g:colors_name')) + end) end) -- cgit From 88cfb49bee3c9102082c7010acb92244e4ad1348 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 07:14:39 +0800 Subject: vim-patch:8.2.4890: inconsistent capitalization in error messages Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar --- test/functional/ex_cmds/highlight_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ex_cmds/highlight_spec.lua') diff --git a/test/functional/ex_cmds/highlight_spec.lua b/test/functional/ex_cmds/highlight_spec.lua index 45764e6719..958dd99226 100644 --- a/test/functional/ex_cmds/highlight_spec.lua +++ b/test/functional/ex_cmds/highlight_spec.lua @@ -24,7 +24,7 @@ describe(':highlight', function() end) it('invalid group name', function() - eq('Vim(highlight):E411: highlight group not found: foo', + eq('Vim(highlight):E411: Highlight group not found: foo', exc_exec("highlight foo")) end) -- cgit