Merge pull request #4733 from AdnoC/hi-link-cleared-group

Fix linking a cleared highlight group

Closes #4549
Closes #2756
Closes #4236
This commit is contained in:
Justin M. Keyes
2016-05-12 02:55:22 -04:00
2 changed files with 46 additions and 1 deletions

View File

@@ -262,4 +262,44 @@ describe('Default highlight groups', function()
]], {[1] = {bold = true, foreground = hlgroup_colors.Question}})
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
end)
it('can be cleared and linked to other highlight groups', function()
execute('highlight clear ModeMsg')
feed('i')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
-- INSERT -- |
]], {})
feed('<esc>')
execute('highlight CustomHLGroup guifg=red guibg=green')
execute('highlight link ModeMsg CustomHLGroup')
feed('i')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
{1:-- INSERT --} |
]], {[1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}})
end)
end)