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

Function ensureCursorVisible

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

Source from the content-addressed store, hash-verified

4698 // Make sure that at the end of the operation the current cursor is
4699 // shown.
4700 function ensureCursorVisible(cm) {
4701 resolveScrollToPos(cm);
4702 var cur = cm.getCursor(), from = cur, to = cur;
4703 if (!cm.options.lineWrapping) {
4704 from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
4705 to = Pos(cur.line, cur.ch + 1);
4706 }
4707 cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};
4708 }
4709
4710 // When an operation has its scrollToPos property set, and another
4711 // scroll action is applied before the end of the operation, this

Callers 4

applyTextInputFunction · 0.85
setSelectionNoUndoFunction · 0.85
deleteNearSelectionFunction · 0.85
codemirror.jsFile · 0.85

Calls 2

resolveScrollToPosFunction · 0.85
getCursorMethod · 0.80

Tested by

no test coverage detected