MCPcopy Create free account
hub / github.com/csev/py4e / removeClearedSpans

Function removeClearedSpans

tools/pythonauto/static/codemirrorepl/codemirror.js:6681–6688  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

6679 // When un/re-doing restores text containing marked spans, those
6680 // that have been explicitly cleared should not be restored.
6681 function removeClearedSpans(spans) {
6682 if (!spans) return null;
6683 for (var i = 0, out; i < spans.length; ++i) {
6684 if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
6685 else if (out) out.push(spans[i]);
6686 }
6687 return !out ? spans : out.length ? out : null;
6688 }
6689
6690 // Retrieve and filter the old marked spans stored in a change event.
6691 function getOldSpans(doc, change) {

Callers 1

getOldSpansFunction · 0.70

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected