Fix #639: Use more careful way to enable numhl

The development versions of v0.3.2 also report `has('nvim-0.3.2')` to be
true even if they do not support the `numhl` feature. So here it catches
and ignores the possible errors.
This commit is contained in:
delphinus
2019-08-12 18:51:06 +09:00
committed by Andy Stewart
parent fef14f1d49
commit f2bf8376ae

View File

@@ -172,6 +172,7 @@ endfunction
function! s:define_sign_linenr_highlights() abort
if has('nvim-0.3.2')
try
if g:gitgutter_highlight_linenrs
sign define GitGutterLineAdded numhl=GitGutterAddLineNr
sign define GitGutterLineModified numhl=GitGutterChangeLineNr
@@ -187,6 +188,8 @@ function! s:define_sign_linenr_highlights() abort
sign define GitGutterLineRemovedAboveAndBelow numhl=
sign define GitGutterLineModifiedRemoved numhl=
endif
catch /E475/
endtry
endif
endfunction