From 13783aea70e599d0897816e59487bb783891a979 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 28 Jun 2020 12:34:50 +0300 Subject: [PATCH] vfmt: support for 'VDIFF_OPTIONS=-w' --- vlib/v/util/errors.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/util/errors.v b/vlib/v/util/errors.v index 4725fd5c83..be7c0b3cd4 100644 --- a/vlib/v/util/errors.v +++ b/vlib/v/util/errors.v @@ -163,9 +163,10 @@ pub fn find_working_diff_command() ?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 ' + - ' --show-function-line="fn " "$file1" "$file2" ' + ' --show-function-line="fn " $other_options "$file1" "$file2" ' x := os.exec(full_cmd) or { return 'comparison command: `${full_cmd}` failed' }