make font weight configurable

People using themes for their terminal emulators that do a lot of
voodoo, could experience sign color problems because of the font being
bold by default.

Thus a new variable was introduced: g:signify_sign_weight.

Fixes #24.
This commit is contained in:
Marco Hinz 2013-04-18 06:55:53 +02:00
parent efe747fda6
commit c4955656ad
3 changed files with 38 additions and 21 deletions

View File

@ -204,6 +204,8 @@ let g:signify_update_on_bufenter = 1
let g:signify_line_highlight = 1
let g:signify_sign_weight = 'bold'
let g:signify_sign_add = '+'
let g:signify_sign_delete = '-'
let g:signify_sign_change = '*'

View File

@ -163,6 +163,17 @@ delays.
Enable line highlighting in addation to using signs.
============-
let g:signify_sign_weight = 'bold'
Possible values: 'bold' (default), 'none'
Use either bold or normal font weight.
NOTE: If you experience colors not getting set properly, try changing this
variable to 'none'.
============-
let g:signify_sign_add = '+'
@ -283,15 +294,17 @@ Thank you for flying mhi airlines. Get the Vim on!
People who contributed to sy. Format: Person (Github account)
Jeremy Mack (mutewinter)
Chong Li (chongli)
Robin Munn (rmunn)
Martin Hoch (rtwo)
fritzophrenic (Ben Fritz)
Morgan Fouesneau (mfouesneau)
Zhao Cai (zhaocai)
Otto Modinos (otommod)
Ryan Kois (kid-icarus)
Jeremy Mack (mutewinter)
Chong Li (chongli)
Robin Munn (rmunn)
Martin Hoch (rtwo)
fritzophrenic (Ben Fritz)
Morgan Fouesneau (mfouesneau)
Zhao Cai (zhaocai)
Otto Modinos (otommod)
Ryan Kois (kid-icarus)
Jon Kinney (j2fly)
Israel Chauca Fuentes (Raimondi)
==============================================================================

View File

@ -372,6 +372,8 @@ endfunction
" Function: s:colors_set {{{1
function! s:colors_set() abort
let weight = get(g:, 'signify_sign_weight', 'bold')
if has('gui_running')
if exists('g:signify_sign_color_guibg')
let guibg = g:signify_sign_color_guibg
@ -386,9 +388,9 @@ function! s:colors_set() abort
else
let guifg_add = get(g:, 'signify_sign_color_guifg_add', '#11ee11')
if empty(guibg) || guibg < 0
execute 'hi SignifyAdd gui=bold guifg='. guifg_add
execute 'hi SignifyAdd gui='. weight .' guifg='. guifg_add
else
execute 'hi SignifyAdd gui=bold guifg='. guifg_add .' guibg='. guibg
execute 'hi SignifyAdd gui='. weight .' guifg='. guifg_add .' guibg='. guibg
endif
endif
@ -397,9 +399,9 @@ function! s:colors_set() abort
else
let guifg_delete = get(g:, 'signify_sign_color_guifg_delete', '#ee1111')
if empty(guibg) || guibg < 0
execute 'hi SignifyDelete gui=bold guifg='. guifg_delete
execute 'hi SignifyDelete gui='. weight .' guifg='. guifg_delete
else
execute 'hi SignifyDelete gui=bold guifg='. guifg_delete .' guibg='. guibg
execute 'hi SignifyDelete gui='. weight .' guifg='. guifg_delete .' guibg='. guibg
endif
endif
@ -408,9 +410,9 @@ function! s:colors_set() abort
else
let guifg_change = get(g:, 'signify_sign_color_guifg_change', '#eeee11')
if empty(guibg) || guibg < 0
execute 'hi SignifyChange gui=bold guifg='. guifg_change
execute 'hi SignifyChange gui='. weight .' guifg='. guifg_change
else
execute 'hi SignifyChange gui=bold guifg='. guifg_change .' guibg='. guibg
execute 'hi SignifyChange gui='. weight .' guifg='. guifg_change .' guibg='. guibg
endif
endif
else
@ -427,9 +429,9 @@ function! s:colors_set() abort
else
let ctermfg_add = get(g:, 'signify_sign_color_ctermfg_add', 2)
if empty(ctermbg) || ctermbg < 0
execute 'hi SignifyAdd cterm=bold ctermfg='. ctermfg_add
execute 'hi SignifyAdd cterm='. weight .' ctermfg='. ctermfg_add
else
execute 'hi SignifyAdd cterm=bold ctermfg='. ctermfg_add .' ctermbg='. ctermbg
execute 'hi SignifyAdd cterm='. weight .' ctermfg='. ctermfg_add .' ctermbg='. ctermbg
endif
endif
@ -438,9 +440,9 @@ function! s:colors_set() abort
else
let ctermfg_delete = get(g:, 'signify_sign_color_ctermfg_delete', 1)
if empty(ctermbg) || ctermbg < 0
execute 'hi SignifyDelete cterm=bold ctermfg='. ctermfg_delete
execute 'hi SignifyDelete cterm='. weight .' ctermfg='. ctermfg_delete
else
execute 'hi SignifyDelete cterm=bold ctermfg='. ctermfg_delete .' ctermbg='. ctermbg
execute 'hi SignifyDelete cterm='. weight .' ctermfg='. ctermfg_delete .' ctermbg='. ctermbg
endif
endif
@ -449,9 +451,9 @@ function! s:colors_set() abort
else
let ctermfg_change = get(g:, 'signify_sign_color_ctermfg_change', 3)
if empty(ctermbg) || ctermbg < 0
execute 'hi SignifyChange cterm=bold ctermfg='. ctermfg_change
execute 'hi SignifyChange cterm='. weight .' ctermfg='. ctermfg_change
else
execute 'hi SignifyChange cterm=bold ctermfg='. ctermfg_change .' ctermbg='. ctermbg
execute 'hi SignifyChange cterm='. weight .' ctermfg='. ctermfg_change .' ctermbg='. ctermbg
endif
endif
endif