mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user