(spans)
| 1424 | // Remove spans that are empty and don't have a clearWhenEmpty |
| 1425 | // option of false. |
| 1426 | function clearEmptySpans(spans) { |
| 1427 | for (var i = 0; i < spans.length; ++i) { |
| 1428 | var span = spans[i]; |
| 1429 | if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) |
| 1430 | { spans.splice(i--, 1); } |
| 1431 | } |
| 1432 | if (!spans.length) { return null } |
| 1433 | return spans |
| 1434 | } |
| 1435 | |
| 1436 | // Used to 'clip' out readOnly ranges when making a change. |
| 1437 | function removeReadOnlyRanges(doc, from, to) { |
no outgoing calls
no test coverage detected