fix(api): make nvim_set_hl() respect all cterm attributes (#31390)

This commit is contained in:
Evgeni Chasnovski
2024-12-02 02:24:58 +02:00
committed by GitHub
parent fb689d7ebd
commit 8de1dc6923
2 changed files with 12 additions and 0 deletions

View File

@@ -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(