MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / createCursorWithColumn

Method createCursorWithColumn

src/utils/Cursor.ts:458–468  ·  view source on GitHub ↗
(
    lineStart: number,
    lineEnd: number,
    targetColumn: number,
  )

Source from the content-addressed store, hash-verified

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)

Callers 2

upLogicalLineMethod · 0.95
downLogicalLineMethod · 0.95

Calls 1

Tested by

no test coverage detected