MCPcopy Index your code
hub / github.com/csev/py4e / clearEmptySpans

Function clearEmptySpans

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

Source from the content-addressed store, hash-verified

5218 // Remove spans that are empty and don't have a clearWhenEmpty
5219 // option of false.
5220 function clearEmptySpans(spans) {
5221 for (var i = 0; i < spans.length; ++i) {
5222 var span = spans[i];
5223 if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
5224 spans.splice(i--, 1);
5225 }
5226 if (!spans.length) return null;
5227 return spans;
5228 }
5229
5230 // Used for un/re-doing changes from the history. Combines the
5231 // result of computing the existing spans with the set of spans that

Callers 1

stretchSpansOverChangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected