Use sign functions, groups, and priority, where available.

On Vims that support it, signs are placed in the "gitgutter" group with
a priority set by g:gitgutter_sign_priority.

Closes #544.
Closes #576.
Closes #627.
This commit is contained in:
Andy Stewart
2019-08-16 16:21:06 +01:00
parent afe94ede1b
commit cbaa22e38c
3 changed files with 182 additions and 117 deletions

View File

@@ -28,7 +28,10 @@ call s:set('g:gitgutter_max_signs', 500)
call s:set('g:gitgutter_signs', 1)
call s:set('g:gitgutter_highlight_lines', 0)
call s:set('g:gitgutter_highlight_linenrs', 0)
if has('nvim-0.4.0') && !exists('g:gitgutter_sign_allow_clobber')
call s:set('g:gitgutter_sign_priority', 10)
" Nvim 0.4.0 has an expanding sign column
" The sign_place() function supports sign priority.
if (has('nvim-0.4.0') || exists('*sign_place')) && !exists('g:gitgutter_sign_allow_clobber')
let g:gitgutter_sign_allow_clobber = 1
endif
call s:set('g:gitgutter_sign_allow_clobber', 0)