From 45a4318bbbcb2c91d95faee6f31e5846ae3f9ec0 Mon Sep 17 00:00:00 2001 From: leeeanh <44962286+leeeanh@users.noreply.github.com> Date: Sun, 17 May 2026 19:05:30 +0700 Subject: 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 --- src/server/headless.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/server/headless.rs') diff --git a/src/server/headless.rs b/src/server/headless.rs index d1c8d144..5f9b62b9 100644 --- a/src/server/headless.rs +++ b/src/server/headless.rs @@ -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 -- cgit v1.2.3