93
94
private _tryRebase(base: StringEdit, noOverlap: boolean): StringEdit | undefined {
96
>
97
>
let baseIdx = 0;
98
>
let ourIdx = 0;
99
>
let offset = 0;
100
>
101
>
while (ourIdx < this.replacements.length || baseIdx < base.replacements.length) {
102
>
// take the edit that starts first
103
>
const baseEdit = base.replacements.at(baseIdx);
104
>
const ourEdit = this.replacements.at(ourIdx);
105
>
106
>
if (!ourEdit) {
107
// We processed all our edits
108
break;
110
// no more edits from base
111
const transformedRange = ourEdit.replaceRange.delta(offset);