@@ -210,7 +210,8 @@ private function mergeChanges(
210
210
foreach ($ baselineParts as $ partKey => &$ part ) {
211
211
if ($ iterator ++ % 2 ) {
212
212
// This part of the line has been changed. Surround it with user defined markers.
213
- $ basePart = $ this ->options ['deleteMarkers ' ][0 ] . $ part . $ this ->options ['deleteMarkers ' ][1 ];
213
+ $ basePart = $ this ->options ['deleteMarkers ' ][0 ] . $ part . $ this ->options ['deleteMarkers ' ][1 ];
214
+ $ changedPart = '' ;
214
215
if (isset ($ changedLineParts [$ partKey ])) {
215
216
$ changedPart =
216
217
$ this ->options ['insertMarkers ' ][0 ] .
@@ -219,13 +220,13 @@ private function mergeChanges(
219
220
}
220
221
221
222
if ($ this ->options ['cliColor ' ]) {
222
- // Colorize the changed part.
223
- [ $ fgColor , $ bgColor ] = $ deleteColors ;
224
- $ basePart = $ colorize -> getColoredString ( $ basePart , $ fgColor , $ bgColor );
225
- [ $ fgColor , $ bgColor ] = $ insertColors ;
226
- $ changedPart = $ colorize -> getColoredString ( $ changedPart , $ fgColor , $ bgColor ); // FIXME
223
+ // Colorize the changed part. $colorize is defined above.
224
+ $ basePart = $ colorize -> getColoredString ( $ basePart , ... $ deleteColors) ;
225
+ if (! empty ( $ changedPart )) {
226
+ $ changedPart = $ colorize -> getColoredString ( $ changedPart , ... $ insertColors) ;
227
+ }
227
228
}
228
- $ part = $ basePart . $ changedPart ; // FIXME
229
+ $ part = $ basePart . $ changedPart ;
229
230
}
230
231
}
231
232
unset($ part );
0 commit comments