MCPcopy Create free account
hub / github.com/sql-js/sql.js / removeClearedSpans

Function removeClearedSpans

GUI/codemirror/lib/codemirror.js:6731–6738  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

6729 // When un/re-doing restores text containing marked spans, those
6730 // that have been explicitly cleared should not be restored.
6731 function removeClearedSpans(spans) {
6732 if (!spans) return null;
6733 for (var i = 0, out; i < spans.length; ++i) {
6734 if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
6735 else if (out) out.push(spans[i]);
6736 }
6737 return !out ? spans : out.length ? out : null;
6738 }
6739
6740 // Retrieve and filter the old marked spans stored in a change event.
6741 function getOldSpans(doc, change) {

Callers 1

getOldSpansFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…