MCPcopy
hub / github.com/claude-code-best/claude-code / prevOffset

Method prevOffset

src/utils/Cursor.ts:1478–1485  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

1476 }
1477
1478 prevOffset(offset: number): number {
1479 if (offset <= 0) return 0
1480
1481 return this.withCache(`prev:${offset}`, () => {
1482 const boundaries = this.getGraphemeBoundaries()
1483 return this.binarySearchBoundary(boundaries, offset, false)
1484 })
1485 }
1486
1487 /**
1488 * Snap an arbitrary code-unit offset to the start of the containing grapheme.

Callers 3

leftMethod · 0.80
retreatMethod · 0.80
findCharacterMethod · 0.80

Calls 3

withCacheMethod · 0.95
getGraphemeBoundariesMethod · 0.95
binarySearchBoundaryMethod · 0.95

Tested by

no test coverage detected