mirror of
https://github.com/neovim/neovim.git
synced 2025-12-03 15:33:03 +00:00
Merge #4800 'syntax: foo=NONE should clear hi group'
This commit is contained in:
@@ -6972,6 +6972,9 @@ set_hl_attr (
|
||||
|| at_en.rgb_sp_color != -1 || at_en.cterm_ae_attr != 0
|
||||
|| at_en.rgb_ae_attr != 0) {
|
||||
sgp->sg_attr = get_attr_entry(&at_en);
|
||||
} else {
|
||||
// If all the fields are cleared, clear the attr field back to default value
|
||||
sgp->sg_attr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -302,6 +302,47 @@ describe('Default highlight groups', function()
|
||||
{1:-- INSERT --} |
|
||||
]], {[1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}})
|
||||
end)
|
||||
it('can be cleared by assigning NONE', function()
|
||||
execute('syn keyword TmpKeyword neovim')
|
||||
execute('hi link TmpKeyword ErrorMsg')
|
||||
insert('neovim')
|
||||
screen:expect([[
|
||||
{1:neovi^m} |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]], {
|
||||
[1] = {foreground = Screen.colors.White, background = Screen.colors.Red}
|
||||
})
|
||||
execute("hi ErrorMsg term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE"
|
||||
.. " gui=NONE guifg=NONE guibg=NONE guisp=NONE")
|
||||
screen:expect([[
|
||||
neovi^m |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]], {})
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('guisp (special/undercurl)', function()
|
||||
|
||||
Reference in New Issue
Block a user