vfmt: support for 'VDIFF_OPTIONS=-w'

pull/5548/head
Delyan Angelov 2020-06-28 12:34:50 +03:00
parent f5fca00d37
commit 13783aea70
1 changed files with 3 additions and 2 deletions

View File

@ -164,8 +164,9 @@ pub fn find_working_diff_command() ?string {
pub fn color_compare_files(diff_cmd, file1, file2 string) string { pub fn color_compare_files(diff_cmd, file1, file2 string) string {
if diff_cmd != '' { if diff_cmd != '' {
mut other_options := os.getenv('VDIFF_OPTIONS')
full_cmd := '$diff_cmd --minimal --text --unified=2 ' + full_cmd := '$diff_cmd --minimal --text --unified=2 ' +
' --show-function-line="fn " "$file1" "$file2" ' ' --show-function-line="fn " $other_options "$file1" "$file2" '
x := os.exec(full_cmd) or { x := os.exec(full_cmd) or {
return 'comparison command: `${full_cmd}` failed' return 'comparison command: `${full_cmd}` failed'
} }