513
};
514
}
516
>
// Need to post-process and introduce changes where the trim whitespace is different
517
>
// Note that we are looping starting at -1 to also cover the lines before the first change
518
>
const result: LineChange[] = [];
519
>
520
>
let originalLineIndex = 0;
521
>
let modifiedLineIndex = 0;
522
>
for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {
523
>
const nextChange = (i + 1 < len ? rawChanges[i + 1] : null);
524
>
const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);
525
>
const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);
526
>
527
>
while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
528
const originalLine = this.originalLines[originalLineIndex];
529
const modifiedLine = this.modifiedLines[modifiedLineIndex];