Scroll the pane when a selection is dragged past its top or bottom #20

Closed
opened 2026-10-15 14:24:34 -05:00 by jeff · 0 comments
Owner

What

Dragging a selection past the top or bottom of a pane should scroll the pane, so that a selection can take in more than the rows on screen. Today the selection stops at the first or last visible row.

Behavior

  • Applies while a left-button selection drag is held and the pointer is above or below the pane the press began in, measured from that pane's edges, not the window's. In a split, dragging down into the pane below already scrolls the top pane.
  • Only up and down. Past the left or right side the selection pins to the first or last column and nothing scrolls.
  • Each step scrolls one row and extends the selection to the row now under the pointer. A timer drives it, not pointer motion, so it keeps going while the pointer is held still.
  • It stops when the pointer comes back inside the pane, or at the top of the scrollback or the live screen. Reaching the end only pauses it; it does not spin there.
  • It stops, leaving the selection as it is, when the button is released (copying to the primary selection as now), the pane closes, the tab changes, the pointer grab is lost, or the program switches to the alternate screen.
  • Every drag that makes a harrier selection: by cell, word, line, a rectangle (alt), and a shift drag over a program that has the mouse. A drag the program receives never autoscrolls.
  • Output arriving mid-drag moves the live screen ahead; autoscroll stops when it reaches it, and the selection stays on its rows.
  • Speed in this issue is fixed: one row every 15 ms, as Ghostty does. Speed by distance is the next issue.

Notes

vt.SelectionGesture.drag already sets left_drag_autoscroll to .up/.down from the pane-relative position harrier passes (src/Window.zig, motion). Nothing calls autoscrollTick. The tick can be a deadline in Window.nextDeadline, which the event loop already waits on. Ghostty's Surface.selectionScrollTick is the reference.

## What Dragging a selection past the top or bottom of a pane should scroll the pane, so that a selection can take in more than the rows on screen. Today the selection stops at the first or last visible row. ## Behavior - Applies while a left-button selection drag is held and the pointer is above or below **the pane the press began in**, measured from that pane's edges, not the window's. In a split, dragging down into the pane below already scrolls the top pane. - Only up and down. Past the left or right side the selection pins to the first or last column and nothing scrolls. - Each step scrolls one row and extends the selection to the row now under the pointer. A timer drives it, not pointer motion, so it keeps going while the pointer is held still. - It stops when the pointer comes back inside the pane, or at the top of the scrollback or the live screen. Reaching the end only pauses it; it does not spin there. - It stops, leaving the selection as it is, when the button is released (copying to the primary selection as now), the pane closes, the tab changes, the pointer grab is lost, or the program switches to the alternate screen. - Every drag that makes a harrier selection: by cell, word, line, a rectangle (alt), and a shift drag over a program that has the mouse. A drag the program receives never autoscrolls. - Output arriving mid-drag moves the live screen ahead; autoscroll stops when it reaches it, and the selection stays on its rows. - Speed in this issue is fixed: one row every 15 ms, as Ghostty does. Speed by distance is the next issue. ## Notes `vt.SelectionGesture.drag` already sets `left_drag_autoscroll` to `.up`/`.down` from the pane-relative position harrier passes (`src/Window.zig`, `motion`). Nothing calls `autoscrollTick`. The tick can be a deadline in `Window.nextDeadline`, which the event loop already waits on. Ghostty's `Surface.selectionScrollTick` is the reference.
jeff closed this issue 2026-10-15 14:40:46 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
jeff/harrier#20
No description provided.