1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: support for 'VDIFF_OPTIONS=-w'

This commit is contained in:
Delyan Angelov 2020-06-28 12:34:50 +03:00
parent f5fca00d37
commit 13783aea70

View File

@ -163,9 +163,10 @@ 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'
} }