MCPcopy Create free account
hub / github.com/coder/ghostty-web / updateAutoScroll

Method updateAutoScroll

lib/selection-manager.ts:673–686  ·  view source on GitHub ↗

* Update auto-scroll based on mouse Y position within canvas

(offsetY: number, canvasHeight: number)

Source from the content-addressed store, hash-verified

671 * Update auto-scroll based on mouse Y position within canvas
672 */
673 private updateAutoScroll(offsetY: number, canvasHeight: number): void {
674 const edgeSize = SelectionManager.AUTO_SCROLL_EDGE_SIZE;
675
676 if (offsetY < edgeSize) {
677 // Near top edge - scroll up
678 this.startAutoScroll(-1);
679 } else if (offsetY > canvasHeight - edgeSize) {
680 // Near bottom edge - scroll down
681 this.startAutoScroll(1);
682 } else {
683 // In middle - stop scrolling
684 this.stopAutoScroll();
685 }
686 }
687
688 /**
689 * Start auto-scrolling in the given direction

Callers 1

attachEventListenersMethod · 0.95

Calls 2

startAutoScrollMethod · 0.95
stopAutoScrollMethod · 0.95

Tested by

no test coverage detected