aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorleeeanh <44962286+leeeanh@users.noreply.github.com>2026-05-17 19:05:30 +0700
committerGitHub <noreply@github.com>2026-05-17 15:05:30 +0300
commit45a4318bbbcb2c91d95faee6f31e5846ae3f9ec0 (patch)
tree0b5f9b8f5b3dfb81a5f2fe4672e148fcbd58473b /src/server
parentf4008dc97a60fb6ce9e75b8b521b21ab38f6ad61 (diff)
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>
Diffstat (limited to 'src/server')
-rw-r--r--src/server/headless.rs9
1 files changed, 9 insertions, 0 deletions
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