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

Function ensureCursorVisible

tools/pythonauto/static/codemirrorepl/codemirror.js:3564–3572  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

3562 // Make sure that at the end of the operation the current cursor is
3563 // shown.
3564 function ensureCursorVisible(cm) {
3565 resolveScrollToPos(cm);
3566 var cur = cm.getCursor(), from = cur, to = cur;
3567 if (!cm.options.lineWrapping) {
3568 from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
3569 to = Pos(cur.line, cur.ch + 1);
3570 }
3571 cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};
3572 }
3573
3574 // When an operation has its scrollToPos property set, and another
3575 // scroll action is applied before the end of the operation, this

Callers 5

setSelectionNoUndoFunction · 0.85
readInputFunction · 0.85
makeChangeFromHistoryFunction · 0.85
deleteNearSelectionFunction · 0.85
codemirror.jsFile · 0.85

Calls 2

resolveScrollToPosFunction · 0.85
PosFunction · 0.85

Tested by

no test coverage detected