aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2024-12-02 02:24:58 +0200
committerGitHub <noreply@github.com>2024-12-02 08:24:58 +0800
commit8de1dc6923396b46c327a31daa8a1562a196a255 (patch)
tree09822d3a27d384279386cc53835fac598e6cbcd7 /test/functional/api/highlight_spec.lua
parentfb689d7ebd680c4921f4ec617fe5e01cd09ba96c (diff)
downloadrneovim-8de1dc6923396b46c327a31daa8a1562a196a255.tar.gz
rneovim-8de1dc6923396b46c327a31daa8a1562a196a255.tar.bz2
rneovim-8de1dc6923396b46c327a31daa8a1562a196a255.zip
fix(api): make `nvim_set_hl()` respect all `cterm` attributes (#31390)
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index 1bbfe203b6..8f98ae3650 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -309,6 +309,15 @@ describe('API: set highlight', function()
eq({ underdotted = true }, api.nvim_get_hl_by_name('Test_hl', true))
end)
+ it('can set all underline cterm attributes #31385', function()
+ local ns = get_ns()
+ local attrs = { 'underline', 'undercurl', 'underdouble', 'underdotted', 'underdashed' }
+ for _, attr in ipairs(attrs) do
+ api.nvim_set_hl(ns, 'Test_' .. attr, { cterm = { [attr] = true } })
+ eq({ [attr] = true }, api.nvim_get_hl_by_name('Test_' .. attr, false))
+ end
+ end)
+
it('can set a highlight in the global namespace', function()
api.nvim_set_hl(0, 'Test_hl', highlight2_config)
eq(