File tree 9 files changed +287
-110
lines changed
9 files changed +287
-110
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,20 @@ class CellInfo {
8
8
public var pretty_value : String ;
9
9
public var category : String ;
10
10
public var category_given_tr : String ;
11
+
12
+ // relevant to updates, conflicts
13
+ public var separator : String ;
14
+ public var updated : Bool ;
15
+ public var conflicted : Bool ;
16
+ public var pvalue : String ;
17
+ public var lvalue : String ;
18
+ public var rvalue : String ;
11
19
12
20
public function new () : Void {}
21
+
22
+ public function toString () : String {
23
+ if (!updated ) return value ;
24
+ if (!conflicted ) return lvalue + "::" + rvalue ;
25
+ return pvalue + "||" + lvalue + "::" + rvalue ;
26
+ }
13
27
}
Original file line number Diff line number Diff line change @@ -7,13 +7,17 @@ class CompareFlags {
7
7
public var always_show_header : Bool ;
8
8
public var show_unchanged : Bool ;
9
9
public var unchanged_context : Int ;
10
- public var show_rc_numbers : Bool ;
10
+ public var always_show_order : Bool ;
11
+ public var never_show_order : Bool ;
12
+ public var ordered : Bool ;
11
13
12
14
public function new () {
13
15
always_show_header = true ;
14
16
show_unchanged = false ;
15
17
unchanged_context = 1 ;
16
- show_rc_numbers = false ;
18
+ always_show_order = false ;
19
+ never_show_order = true ;
20
+ ordered = true ;
17
21
}
18
22
}
19
23
Original file line number Diff line number Diff line change @@ -72,15 +72,19 @@ class DiffRender {
72
72
}
73
73
74
74
75
- private static function examineCell (x : Int ,
76
- y : Int ,
77
- value : String ,
78
- vcol : String ,
79
- vrow : String ,
80
- vcorner : String ,
81
- cell : CellInfo ) : Void {
75
+ public static function examineCell (x : Int ,
76
+ y : Int ,
77
+ value : String ,
78
+ vcol : String ,
79
+ vrow : String ,
80
+ vcorner : String ,
81
+ cell : CellInfo ) : Void {
82
82
cell .category = "" ;
83
83
cell .category_given_tr = "" ;
84
+ cell .separator = "" ;
85
+ cell .conflicted = false ;
86
+ cell .updated = false ;
87
+ cell .pvalue = cell .lvalue = cell .rvalue = null ;
84
88
cell .value = value ;
85
89
if (cell .value ==null ) cell .value = "" ;
86
90
cell .pretty_value = cell .value ;
@@ -117,10 +121,18 @@ class DiffRender {
117
121
if (cell .value .indexOf (full )>=0 ) {
118
122
div = full ;
119
123
cat = "conflict" ;
124
+ cell .conflicted = true ;
120
125
}
121
126
}
122
- cell .pretty_value = cell .pretty_value .split (div ).join (String .fromCharCode (8594 ));
127
+ cell .updated = true ;
128
+ cell .separator = div ;
129
+ tokens = cell .pretty_value .split (div );
130
+ cell .pretty_value = tokens .join (String .fromCharCode (8594 ));
123
131
cell .category_given_tr = cell .category = cat ;
132
+ var offset : Int = cell .conflicted ?1 :0 ;
133
+ cell .lvalue = tokens [offset ];
134
+ cell .rvalue = tokens [offset +1 ];
135
+ if (cell .conflicted ) cell .pvalue = tokens [0 ];
124
136
}
125
137
}
126
138
}
You can’t perform that action at this time.
0 commit comments