mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 20:13:46 -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
|
endif
|
||||||
|
|
||||||
if a:use_external_grep && s:grep_available
|
if a:use_external_grep && s:grep_available
|
||||||
" grep exits with 1 when no matches are found. However we want to treat
|
let cmd .= s:grep_command
|
||||||
" non-matches as non-erroneous behaviour; so we OR the command with one
|
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.
|
" which always returns true.
|
||||||
let cmd .= s:grep_command . ' || true'
|
let cmd.= ' || true'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cmd .= '))'
|
let cmd .= '))'
|
||||||
|
|||||||
Reference in New Issue
Block a user