(a, b)
| 1486 | // spans is larger (and thus includes the other). Falls back to |
| 1487 | // comparing ids when the spans cover exactly the same range. |
| 1488 | function compareCollapsedMarkers(a, b) { |
| 1489 | var lenDiff = a.lines.length - b.lines.length; |
| 1490 | if (lenDiff != 0) { return lenDiff } |
| 1491 | var aPos = a.find(), bPos = b.find(); |
| 1492 | var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); |
| 1493 | if (fromCmp) { return -fromCmp } |
| 1494 | var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); |
| 1495 | if (toCmp) { return toCmp } |
| 1496 | return b.id - a.id |
| 1497 | } |
| 1498 | |
| 1499 | // Find out whether a line ends or starts in a collapsed span. If |
| 1500 | // so, return the marker for that span. |
no test coverage detected