(spans)
| 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) { |
no outgoing calls
no test coverage detected