MCPcopy
hub / github.com/witheve/Eve / resolveScrollToPos

Function resolveScrollToPos

src/codemirror.js:4714–4725  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

4712 // 'simulates' scrolling that position into view in a cheap way, so
4713 // that the effect of intermediate scroll commands is not ignored.
4714 function resolveScrollToPos(cm) {
4715 var range = cm.curOp.scrollToPos;
4716 if (range) {
4717 cm.curOp.scrollToPos = null;
4718 var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);
4719 var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
4720 Math.min(from.top, to.top) - range.margin,
4721 Math.max(from.right, to.right),
4722 Math.max(from.bottom, to.bottom) + range.margin);
4723 cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);
4724 }
4725 }
4726
4727 // API UTILITIES
4728

Callers 3

addToScrollPosFunction · 0.85
ensureCursorVisibleFunction · 0.85
codemirror.jsFile · 0.85

Calls 3

estimateCoordsFunction · 0.85
calculateScrollPosFunction · 0.85
scrollToMethod · 0.80

Tested by

no test coverage detected