399
400
while (x !== SENTINEL) {
401
>
if (x.left !== SENTINEL && x.lf_left + 1 >= lineNumber) {
pieceTreeBase.ts
402
x = x.left;
403
>
} else if (x.lf_left + x.piece.lineFeedCnt + 1 >= lineNumber) {
pieceTreeBase.ts
404
>
leftLen += x.size_left;
405
>
// lineNumber >= 2
406
>
const accumualtedValInCurrentIndex = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);
407
>
return leftLen += accumualtedValInCurrentIndex + column - 1;
408
>
} else {
409
lineNumber -= x.lf_left + x.piece.lineFeedCnt;
410
leftLen += x.size_left + x.piece.length;
411
x = x.right;
412
}
414
415
return leftLen;