Treat cleared highlight groups as not set

Setting a colorscheme often clears all existing highlight groups.  When
the plugin subsequently sets up its colours, it sees that the GitGutter*
groups exist and leaves them alone - even though they have been cleared.

This change means cleared groups do get their colours set up again.

See #727.
This commit is contained in:
Andy Stewart
2020-08-05 12:15:27 +01:00
parent 62ff20f979
commit 642cef87f4

View File

@@ -77,7 +77,7 @@ function! gitgutter#highlight#define_highlights() abort
" When they are visible.
for type in ["Add", "Change", "Delete"]
if hlexists("GitGutter".type)
if hlexists("GitGutter".type) && s:get_foreground_colors('Diff'.type) != ['NONE', 'NONE']
if g:gitgutter_set_sign_backgrounds
execute "highlight GitGutter".type." guibg=".guibg." ctermbg=".ctermbg
endif