(pos: Position)
| 209 | } |
| 210 | |
| 211 | private convertToOffset(pos: Position): number { |
| 212 | if (pos.line < this._lines.length) { |
| 213 | return ( |
| 214 | this._lines[pos.line].offset + |
| 215 | Math.min(this._lines[pos.line].rangeIncludingLineBreak.end.character, pos.character) |
| 216 | ); |
| 217 | } |
| 218 | return this._contents.length; |
| 219 | } |
| 220 | } |