add option for inheritating colors from LineNr

This commit is contained in:
Marco Hinz 2013-03-17 00:42:11 +01:00
parent 96d8bc1777
commit a47cb357b4
2 changed files with 11 additions and 2 deletions

View File

@ -159,6 +159,11 @@ Example:
The highlight groups to use with line highlighting.
let g:signify_sign_color_inherit_from_linenr = 1
Make SignColumn use the same color as LineNr.
let g:signify_enable_cvs = 1
Enable CVS repo detection.

View File

@ -395,6 +395,8 @@ function! s:colors_set() abort
if has('gui_running')
if exists('g:signify_sign_color_guibg')
let guibg = g:signify_sign_color_guibg
elseif exists('g:signify_sign_color_inherit_from_linenr')
let guibg = synIDattr(hlID('LineNr'), 'bg', 'gui')
endif
if !exists('guibg')
@ -408,7 +410,7 @@ function! s:colors_set() abort
if empty(guibg) || guibg < 0
exe 'hi SignifyAdd gui=bold guifg='. guifg_add
else
exe 'hi SignifyAdd gui=bold guifg='. guifg_add .' guibg='. guibg
exe 'hi SignifyAdd gui=bold guifg='. guifg_add .' guibg='. guibg
endif
endif
@ -436,6 +438,8 @@ function! s:colors_set() abort
else
if exists('g:signify_sign_color_ctermbg')
let ctermbg = g:signify_sign_color_ctermbg
elseif exists('g:signify_sign_color_inherit_from_linenr')
let guibg = synIDattr(hlID('LineNr'), 'bg', 'cterm')
endif
if !exists('ctermbg')
@ -449,7 +453,7 @@ function! s:colors_set() abort
if empty(ctermbg) || ctermbg < 0
exe 'hi SignifyAdd cterm=bold ctermfg='. ctermfg_add
else
exe 'hi SignifyAdd cterm=bold ctermfg='. ctermfg_add .' ctermbg='. ctermbg
exe 'hi SignifyAdd cterm=bold ctermfg='. ctermfg_add .' ctermbg='. ctermbg
endif
endif