MCPcopy Create free account
hub / github.com/breck7/scroll / clearEmptySpans

Function clearEmptySpans

external/.scrollLibs.js:1322–1333  ·  view source on GitHub ↗
(spans)

Source from the content-addressed store, hash-verified

1320 // Remove spans that are empty and don't have a clearWhenEmpty
1321 // option of false.
1322 function clearEmptySpans(spans) {
1323 for (var i = 0; i < spans.length; ++i) {
1324 var span = spans[i]
1325 if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) {
1326 spans.splice(i--, 1)
1327 }
1328 }
1329 if (!spans.length) {
1330 return null
1331 }
1332 return spans
1333 }
1334
1335 // Used to 'clip' out readOnly ranges when making a change.
1336 function removeReadOnlyRanges(doc, from, to) {

Callers 1

stretchSpansOverChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected