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

Method shiftSelectionForScroll

src/ink/ink.tsx:1168–1178  ·  view source on GitHub ↗

* Shift anchor AND focus by dRow, clamped to [minRow, maxRow]. Used by * keyboard scroll handlers (PgUp/PgDn etc.) so the highlight tracks the * content instead of disappearing. Unlike shiftAnchor (drag-to-scroll), * this moves BOTH endpoints — the user isn't holding the mouse at one * e

(dRow: number, minRow: number, maxRow: number)

Source from the content-addressed store, hash-verified

1166 * edge. Supplies screen.width for the col-reset-on-clamp boundary.
1167 */
1168 shiftSelectionForScroll(dRow: number, minRow: number, maxRow: number): void {
1169 const hadSel = hasSelection(this.selection);
1170 shiftSelection(this.selection, dRow, minRow, maxRow, this.frontFrame.screen.width);
1171 // shiftSelection clears when both endpoints overshoot the same edge
1172 // (Home/g/End/G page-jump past the selection). Notify subscribers so
1173 // useHasSelection updates. Safe to call notifySelectionChange here —
1174 // this runs from keyboard handlers, not inside onRender().
1175 if (hadSel && !hasSelection(this.selection)) {
1176 this.notifySelectionChange();
1177 }
1178 }
1179
1180 /**
1181 * Keyboard selection extension (shift+arrow/home/end). Moves focus;

Callers 1

useSelectionFunction · 0.80

Calls 3

notifySelectionChangeMethod · 0.95
hasSelectionFunction · 0.85
shiftSelectionFunction · 0.85

Tested by

no test coverage detected