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

Method upLogicalLine

src/utils/Cursor.ts:486–506  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

484 }
485
486 upLogicalLine(): Cursor {
487 const { start: currentStart } = this.getLogicalLineBounds()
488
489 // At first line - stay at beginning
490 if (currentStart === 0) {
491 return new Cursor(this.measuredText, 0, 0)
492 }
493
494 // Calculate target column position
495 const currentColumn = this.offset - currentStart
496
497 // Find previous line bounds
498 const prevLineEnd = currentStart - 1
499 const prevLineStart = this.findLogicalLineStart(prevLineEnd)
500
501 return this.createCursorWithColumn(
502 prevLineStart,
503 prevLineEnd,
504 currentColumn,
505 )
506 }
507
508 downLogicalLine(): Cursor {
509 const { start: currentStart, end: currentEnd } = this.getLogicalLineBounds()

Callers 2

applySingleMotionFunction · 0.80
upOrHistoryUpFunction · 0.80

Calls 3

getLogicalLineBoundsMethod · 0.95
findLogicalLineStartMethod · 0.95

Tested by

no test coverage detected