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

Method upLogicalLine

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

Source from the content-addressed store, hash-verified

509 }
510
511 upLogicalLine(): Cursor {
512 const { start: currentStart } = this.getLogicalLineBounds()
513
514 // At first line - stay at beginning
515 if (currentStart === 0) {
516 return new Cursor(this.measuredText, 0, 0)
517 }
518
519 // Calculate target column position
520 const currentColumn = this.offset - currentStart
521
522 // Find previous line bounds
523 const prevLineEnd = currentStart - 1
524 const prevLineStart = this.findLogicalLineStart(prevLineEnd)
525
526 return this.createCursorWithColumn(
527 prevLineStart,
528 prevLineEnd,
529 currentColumn,
530 )
531 }
532
533 downLogicalLine(): Cursor {
534 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