mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Set correct background on existing GitGutter* highlight groups
Previously if the user or the colourscheme had already defined GitGutter* highlight groups, the plugin would leave their backgrounds alone. This pushed the responsibility for figuring out and specifying the correct backgrounds onto the user or colourscheme maintainer. With this change the plugin now sets the correct background on existing GitGutter* highlight groups. Also, the documentation was simplified so it is clearer how to set your own colours for the signs.
This commit is contained in:
@@ -84,6 +84,15 @@ function! gitgutter#highlight#define_highlights() abort
|
||||
highlight default link GitGutterChangeDeleteInvisible GitGutterChangeInvisible
|
||||
|
||||
" When they are visible.
|
||||
|
||||
" If GitGutter* highlights are already defined, either by the user or the colourscheme,
|
||||
" set their backgrounds to the sign column's.
|
||||
for type in ["Add", "Change", "Delete"]
|
||||
if hlexists("GitGutter".type)
|
||||
execute "highlight GitGutter".type." guibg=".guibg." ctermbg=".ctermbg
|
||||
endif
|
||||
endfor
|
||||
|
||||
" By default use Diff* foreground colors with SignColumn's background.
|
||||
for type in ['Add', 'Change', 'Delete']
|
||||
let [guifg, ctermfg] = s:get_foreground_colors('Diff'.type)
|
||||
|
||||
Reference in New Issue
Block a user