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

Function removeClearedSpans

static/js/codemirror/codemirror.js:4721–4728  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

4719 }
4720
4721 function removeClearedSpans(spans) {
4722 if (!spans) return null;
4723 for (var i = 0, out; i < spans.length; ++i) {
4724 if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
4725 else if (out) out.push(spans[i]);
4726 }
4727 return !out ? spans : out.length ? out : null;
4728 }
4729
4730 function getOldSpans(doc, change) {
4731 var found = change["spans_" + doc.id];

Callers 1

getOldSpansFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected