MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createCursorWithColumn

Method createCursorWithColumn

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

Source from the content-addressed store, hash-verified

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)

Callers 2

upLogicalLineMethod · 0.95
downLogicalLineMethod · 0.95

Calls 1

Tested by

no test coverage detected