* 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)
| 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; |
no test coverage detected