Suppress non-zero exit codes for diff.

Exactly as we do for `grep`.
This commit is contained in:
Andy Stewart
2014-02-26 16:44:39 +01:00
parent 7e8d2fb5a6
commit aeec864d8d

View File

@@ -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 .= '))'