mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
Suppress non-zero exit codes for diff.
Exactly as we do for `grep`.
This commit is contained in:
@@ -17,10 +17,15 @@ function! diff#run_diff(realtime, use_external_grep)
|
||||
endif
|
||||
|
||||
if a:use_external_grep && s:grep_available
|
||||
" grep exits with 1 when no matches are found. However we want to treat
|
||||
" non-matches as non-erroneous behaviour; so we OR the command with one
|
||||
let cmd .= s:grep_command
|
||||
endif
|
||||
|
||||
if (a:use_external_grep && s:grep_available) || a:realtime
|
||||
" grep exits with 1 when no matches are found; diff exits with 1 when
|
||||
" differences are found. However we want to treat non-matches and
|
||||
" differences as non-erroneous behaviour; so we OR the command with one
|
||||
" which always returns true.
|
||||
let cmd .= s:grep_command . ' || true'
|
||||
let cmd.= ' || true'
|
||||
endif
|
||||
|
||||
let cmd .= '))'
|
||||
|
||||
Reference in New Issue
Block a user