Do not set background on existing GitGutter* highlights unless requested

If GitGutter* highlight groups already exist, they were declared
deliberately (either by the colorscheme maintainer or the user).  So do
not adjust them.

However if you would like to make the signs' backgrounds match the sign
column, you can do this:

    let g:gitgutter_set_sign_backgrounds = 1
This commit is contained in:
Andy Stewart
2020-04-30 19:43:02 +01:00
parent 0da302c28a
commit 76d1cf609d
4 changed files with 22 additions and 11 deletions

View File

@@ -76,11 +76,12 @@ function! gitgutter#highlight#define_highlights() abort
highlight default link GitGutterChangeDeleteInvisible GitGutterChangeInvisible
" When they are visible.
" The background colours are set to the sign column's.
for type in ["Add", "Change", "Delete"]
if hlexists("GitGutter".type)
let [guifg, ctermfg] = s:get_foreground_colors('GitGutter'.type)
if g:gitgutter_set_sign_backgrounds
execute "highlight GitGutter".type." guibg=".guibg." ctermbg=".ctermbg
endif
continue
elseif s:useful_diff_colours()
let [guifg, ctermfg] = s:get_foreground_colors('Diff'.type)
else