-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiffC
32 lines (29 loc) · 1.07 KB
/
diffC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
exec '/usr/bin/diff' \
--unchanged-group-format='' \
--old-group-format=\
'%c'\''\033'\''[1;97;40m|%c'\''\033'\''[91m*%c'\''\033'\''[97m| Line %dF%c'\''\033'\''[0;97;40m: missing %dn line%(n=1?:s):%c'\''\033'\''[m
%c'\''\033'\''[36m[[%c'\''\033'\''[31m
%<%c'\''\033'\''[36m]]
%c'\''\033'\''[37;40m(line %(n=1?%df:%df - %dl))%c'\''\033'\''[m
' \
--new-group-format=\
'%c'\''\033'\''[1;97;40m|%c'\''\033'\''[92m*%c'\''\033'\''[97m| Line %dF%c'\''\033'\''[0;97;40m: additional %dN line%(N=1?:s):%c'\''\033'\''[m
%c'\''\033'\''[36m[[%c'\''\033'\''[32m
%>%c'\''\033'\''[36m]]%c'\''\033'\''[m
' \
--changed-group-format=\
'%c'\''\033'\''[1;97;40m|%c'\''\033'\''[93m*%c'\''\033'\''[97m| Line %dF%c'\''\033'\''[0;97;40m: changed %dN line%(N=1?:s):%c'\''\033'\''[m
%c'\''\033'\''[36m[[%c'\''\033'\''[32m
%>%c'\''\033'\''[36m]]%c'\''\033'\''[m
, from:
%c'\''\033'\''[36m[[%c'\''\033'\''[31m
%<%c'\''\033'\''[36m]]
%c'\''\033'\''[37;40m(line %(n=1?%df:%df - %dl))%c'\''\033'\''[m
' \
"$@";
#
# RegEx (Perl) matching all formatting codes above:
# [[
# %c'\\''\\033'\\''\[\d{0,3}(?:;\d{0,3})*m
# ]]
#