(
lineStart: number,
lineEnd: number,
targetColumn: number,
)
| 456 | // Helper to create cursor with preserved column, clamped to line length |
| 457 | // Snaps to grapheme boundary to avoid landing mid-grapheme |
| 458 | private createCursorWithColumn( |
| 459 | lineStart: number, |
| 460 | lineEnd: number, |
| 461 | targetColumn: number, |
| 462 | ): Cursor { |
| 463 | const lineLength = lineEnd - lineStart |
| 464 | const clampedColumn = Math.min(targetColumn, lineLength) |
| 465 | const rawOffset = lineStart + clampedColumn |
| 466 | const offset = this.measuredText.snapToGraphemeBoundary(rawOffset) |
| 467 | return new Cursor(this.measuredText, offset, 0) |
| 468 | } |
| 469 | |
| 470 | endOfLogicalLine(): Cursor { |
| 471 | return new Cursor(this.measuredText, this.findLogicalLineEnd(), 0) |
no test coverage detected