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

Function moveV

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1490–1499  ·  view source on GitHub ↗
(dir, unit)

Source from the content-addressed store, hash-verified

1488 }
1489 var goalColumn = null;
1490 function moveV(dir, unit) {
1491 var dist = 0, pos = localCoords(sel.inverted ? sel.from : sel.to, true);
1492 if (goalColumn != null) pos.x = goalColumn;
1493 if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight);
1494 else if (unit == "line") dist = textHeight();
1495 var target = coordsChar(pos.x, pos.y + dist * dir + 2);
1496 if (unit == "page") scroller.scrollTop += localCoords(target, true).y - pos.y;
1497 setCursor(target.line, target.ch, true);
1498 goalColumn = pos.x;
1499 }
1500
1501 function selectWordAt(pos) {
1502 var line = getLine(pos.line).text;

Callers

nothing calls this directly

Calls 4

localCoordsFunction · 0.85
setCursorFunction · 0.85
textHeightFunction · 0.70
coordsCharFunction · 0.70

Tested by

no test coverage detected