(
lineStart: number,
lineEnd: number,
targetColumn: number,
)
| 481 | // Helper to create cursor with preserved column, clamped to line length |
| 482 | // Snaps to grapheme boundary to avoid landing mid-grapheme |
| 483 | private createCursorWithColumn( |
| 484 | lineStart: number, |
| 485 | lineEnd: number, |
| 486 | targetColumn: number, |
| 487 | ): Cursor { |
| 488 | const lineLength = lineEnd - lineStart |
| 489 | const clampedColumn = Math.min(targetColumn, lineLength) |
| 490 | const rawOffset = lineStart + clampedColumn |
| 491 | const offset = this.measuredText.snapToGraphemeBoundary(rawOffset) |
| 492 | return new Cursor(this.measuredText, offset, 0) |
| 493 | } |
| 494 | |
| 495 | endOfLogicalLine(): Cursor { |
| 496 | return new Cursor(this.measuredText, this.findLogicalLineEnd(), 0) |
no test coverage detected