96
97
private _computeLineOffsets(): void {
99
>
this._lineEndOffsetByLineIdx = [];
100
>
101
>
this._lineStartOffsetByLineIdx.push(0);
102
>
for (let i = 0; i < this.text.length; i++) {
103
>
if (this.text.charAt(i) === '\n') {
104
>
this._lineStartOffsetByLineIdx.push(i + 1);
105
>
if (i > 0 && this.text.charAt(i - 1) === '\r') {
106
this._lineEndOffsetByLineIdx.push(i - 1);
108
this._lineEndOffsetByLineIdx.push(i);
109
}
111
>
}
112
>
this._lineEndOffsetByLineIdx.push(this.text.length);
113
>
}
114
115
override getOffset(position: Position): number {