diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
| commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
| tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /test/functional/api/highlight_spec.lua | |
| parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
| parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
| download | rneovim-rahm.tar.gz rneovim-rahm.tar.bz2 rneovim-rahm.zip | |
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
| -rw-r--r-- | test/functional/api/highlight_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index dd0611f184..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( @@ -710,4 +719,18 @@ describe('API: set/get highlight namespace', function() api.nvim_win_set_hl_ns(0, ns) eq(ns, api.nvim_get_hl_ns({ winid = 0 })) end) + + it('setting namespace takes priority over &winhighlight', function() + command('set winhighlight=Visual:Search') + n.insert('foobar') + local ns = api.nvim_create_namespace('') + api.nvim_win_set_hl_ns(0, ns) + eq(ns, api.nvim_get_hl_ns({ winid = 0 })) + command('enew') -- switching buffer keeps namespace #30904 + eq(ns, api.nvim_get_hl_ns({ winid = 0 })) + command('set winhighlight=') + eq(ns, api.nvim_get_hl_ns({ winid = 0 })) + command('set winhighlight=Visual:Search') + eq(ns, api.nvim_get_hl_ns({ winid = 0 })) + end) end) |