MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / moveOnce

Function moveOnce

static/js/codemirror/codemirror.js:2530–2539  ·  view source on GitHub ↗
(boundToLine)

Source from the content-addressed store, hash-verified

2528 return lineObj = getLine(doc, l);
2529 }
2530 function moveOnce(boundToLine) {
2531 var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);
2532 if (next == null) {
2533 if (!boundToLine && findNextLine()) {
2534 if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
2535 else ch = dir < 0 ? lineObj.text.length : 0;
2536 } else return (possible = false);
2537 } else ch = next;
2538 return true;
2539 }
2540
2541 if (unit == "char") moveOnce();
2542 else if (unit == "column") moveOnce(true);

Callers 1

findPosHFunction · 0.85

Calls 1

findNextLineFunction · 0.85

Tested by

no test coverage detected