feat: add selection autoscroll and fix stale selection on transitions (#129)

When dragging to select text near pane edges, a 30ms recurring tick
now continues scrolling and extending the selection while the mouse
is idle. The autoscroll stops on MouseUp, key input, navigate action,
cursor leaving the hot zone, scrollback boundary, missing metrics,
or pane rect change.

Also fixes pre-existing bugs where workspace/tab/pane transitions
failed to clear selection state, which could cause stale selections
to persist across views. Selection clearing on pane death is scoped
to only the dying pane.

Also fixes anchor_screen_pos returning pane-relative coordinates
instead of screen coordinates, which caused false drag detection
and spurious edge autoscroll on same-cell events when the pane
has a non-zero origin.

refs #128

Co-authored-by: leeanh <mac@macs-MacBook-Pro.local>
This commit is contained in:
leeeanh
2026-05-17 15:05:30 +03:00
committed by GitHub
co-authored by leeanh
parent f4008dc97a
commit 45a4318bbb
11 changed files with 736 additions and 19 deletions
+9
View File
@@ -2024,6 +2024,15 @@ impl HeadlessServer {
changed = true;
}
if self
.app
.selection_autoscroll_deadline
.is_some_and(|deadline| now >= deadline)
{
self.app.tick_selection_autoscroll(now);
changed = true;
}
self.app.start_git_status_refresh_if_due(now);
if self