MCPcopy Create free account
hub / github.com/Noumena-Network/code / shiftSelectionForScroll

Method shiftSelectionForScroll

src/ink/ink.tsx:1321–1331  ·  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

1319 * edge. Supplies screen.width for the col-reset-on-clamp boundary.
1320 */
1321 shiftSelectionForScroll(dRow: number, minRow: number, maxRow: number): void {
1322 const hadSel = hasSelection(this.selection);
1323 shiftSelection(this.selection, dRow, minRow, maxRow, this.frontFrame.screen.width);
1324 // shiftSelection clears when both endpoints overshoot the same edge
1325 // (Home/g/End/G page-jump past the selection). Notify subscribers so
1326 // useHasSelection updates. Safe to call notifySelectionChange here —
1327 // this runs from keyboard handlers, not inside onRender().
1328 if (hadSel && !hasSelection(this.selection)) {
1329 this.notifySelectionChange();
1330 }
1331 }
1332
1333 /**
1334 * 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