From a194e9da01dca2893cb7c40ca1bd20024427e9df Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Mon, 27 Apr 2020 14:09:56 +0100 Subject: [PATCH] When git cannot be found only warn if plugin enabled This enables the plugin to be loaded on systems without git, without emitting any warnings. See #702. --- plugin/gitgutter.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 33f0b07..b34b64a 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -69,7 +69,9 @@ call s:set('g:gitgutter_use_location_list', 0) call s:set('g:gitgutter_git_executable', 'git') if !executable(g:gitgutter_git_executable) - call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.') + if g:gitgutter_enabled + call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.') + endif endif let default_grep = 'grep'