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

Function changeLine

static/js/codemirror/codemirror.js:2510–2518  ·  view source on GitHub ↗
(cm, handle, op)

Source from the content-addressed store, hash-verified

2508 }
2509
2510 function changeLine(cm, handle, op) {
2511 var no = handle, line = handle, doc = cm.doc;
2512 if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle));
2513 else no = lineNo(handle);
2514 if (no == null) return null;
2515 if (op(line, no)) regChange(cm, no, no + 1);
2516 else return null;
2517 return line;
2518 }
2519
2520 function findPosH(doc, pos, dir, unit, visually) {
2521 var line = pos.line, ch = pos.ch;

Callers 2

codemirror.jsFile · 0.85
addLineWidgetFunction · 0.85

Calls 4

getLineFunction · 0.85
clipLineFunction · 0.85
lineNoFunction · 0.85
regChangeFunction · 0.85

Tested by

no test coverage detected