MCPcopy Create free account
hub / github.com/rhysd/Tui / scrollToFitEdge

Method scrollToFitEdge

webview/keymaps_handler.ts:616–621  ·  view source on GitHub ↗
(fitted: number, willFit: number, viewTop?: number)

Source from the content-addressed store, hash-verified

614
615 // If viewTop is not given, it means returned value is unused.
616 private scrollToFitEdge(fitted: number, willFit: number, viewTop?: number) {
617 window.scrollBy(0, willFit - fitted);
618 // Return really scrolled. If viewTop is not given, do not access
619 // to document.body.scrollTop because it causes reflow.
620 return viewTop === undefined || document.body.scrollTop !== viewTop;
621 }
622}

Callers 1

moveFocusByOffsetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected