(a, b)
| 1407 | // spans is larger (and thus includes the other). Falls back to |
| 1408 | // comparing ids when the spans cover exactly the same range. |
| 1409 | function compareCollapsedMarkers(a, b) { |
| 1410 | var lenDiff = a.lines.length - b.lines.length |
| 1411 | if (lenDiff != 0) { |
| 1412 | return lenDiff |
| 1413 | } |
| 1414 | var aPos = a.find(), |
| 1415 | bPos = b.find() |
| 1416 | var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b) |
| 1417 | if (fromCmp) { |
| 1418 | return -fromCmp |
| 1419 | } |
| 1420 | var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b) |
| 1421 | if (toCmp) { |
| 1422 | return toCmp |
| 1423 | } |
| 1424 | return b.id - a.id |
| 1425 | } |
| 1426 | |
| 1427 | // Find out whether a line ends or starts in a collapsed span. If |
| 1428 | // so, return the marker for that span. |
no test coverage detected