MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / resolveScrollToPos

Function resolveScrollToPos

lib/web/CodeMirror/src/display/scrolling.js:139–146  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

137// 'simulates' scrolling that position into view in a cheap way, so
138// that the effect of intermediate scroll commands is not ignored.
139function resolveScrollToPos(cm) {
140 let range = cm.curOp.scrollToPos
141 if (range) {
142 cm.curOp.scrollToPos = null
143 let from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
144 scrollToCoordsRange(cm, from, to, range.margin)
145 }
146}
147
148export function scrollToCoordsRange(cm, from, to, margin) {
149 let sPos = calculateScrollPos(cm, {

Callers 4

addToScrollTopFunction · 0.70
ensureCursorVisibleFunction · 0.70
scrollToCoordsFunction · 0.70
scrollToRangeFunction · 0.70

Calls 2

estimateCoordsFunction · 0.90
scrollToCoordsRangeFunction · 0.70

Tested by

no test coverage detected