MCPcopy
hub / github.com/csev/py4e / addToScrollPos

Function addToScrollPos

tools/pythonauto/static/codemirrorepl/codemirror.js:3554–3560  ·  view source on GitHub ↗
(cm, left, top)

Source from the content-addressed store, hash-verified

3552 // Store a relative adjustment to the scroll position in the current
3553 // operation (to be applied when the operation finishes).
3554 function addToScrollPos(cm, left, top) {
3555 if (left != null || top != null) resolveScrollToPos(cm);
3556 if (left != null)
3557 cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;
3558 if (top != null)
3559 cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
3560 }
3561
3562 // Make sure that at the end of the operation the current cursor is
3563 // shown.

Callers 3

codemirror.jsFile · 0.70
addLineWidgetFunction · 0.70

Calls 1

resolveScrollToPosFunction · 0.85

Tested by

no test coverage detected