129
130
private offsetInInputWithInjectionsToOutputPosition(offsetInInputWithInjections: number, affinity: PositionAffinity = PositionAffinity.None): OutputPosition {
132
>
let high = this.breakOffsets.length - 1;
133
>
let mid = 0;
134
>
let midStart = 0;
135
>
136
>
while (low <= high) {
137
>
mid = low + ((high - low) / 2) | 0;
138
>
139
>
const midStop = this.breakOffsets[mid];
140
>
midStart = mid > 0 ? this.breakOffsets[mid - 1] : 0;
141
>
142
>
if (affinity === PositionAffinity.Left) {
143
if (offsetInInputWithInjections <= midStart) {
144
high = mid - 1;