MCPcopy Create free account
hub / github.com/TruthHun/BookStack / regLineChange

Function regLineChange

static/editor.md/lib/codemirror/lib/codemirror.js:3197–3208  ·  view source on GitHub ↗
(cm, line, type)

Source from the content-addressed store, hash-verified

3195 // Register a change to a single line. Type must be one of "text",
3196 // "gutter", "class", "widget"
3197 function regLineChange(cm, line, type) {
3198 cm.curOp.viewChanged = true;
3199 var display = cm.display, ext = cm.display.externalMeasured;
3200 if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
3201 display.externalMeasured = null;
3202
3203 if (line < display.viewFrom || line >= display.viewTo) return;
3204 var lineView = display.view[findViewIndex(cm, line)];
3205 if (lineView.node == null) return;
3206 var arr = lineView.changes || (lineView.changes = []);
3207 if (indexOf(arr, type) == -1) arr.push(type);
3208 }
3209
3210 // Clear the view.
3211 function resetView(cm) {

Callers 6

highlightWorkerFunction · 0.70
shiftDocFunction · 0.70
changeLineFunction · 0.70
codemirror.jsFile · 0.70
markTextFunction · 0.70

Calls 2

findViewIndexFunction · 0.70
indexOfFunction · 0.70

Tested by

no test coverage detected