(a, b)
| 5306 | // spans is larger (and thus includes the other). Falls back to |
| 5307 | // comparing ids when the spans cover exactly the same range. |
| 5308 | function compareCollapsedMarkers(a, b) { |
| 5309 | var lenDiff = a.lines.length - b.lines.length; |
| 5310 | if (lenDiff != 0) return lenDiff; |
| 5311 | var aPos = a.find(), bPos = b.find(); |
| 5312 | var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); |
| 5313 | if (fromCmp) return -fromCmp; |
| 5314 | var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); |
| 5315 | if (toCmp) return toCmp; |
| 5316 | return b.id - a.id; |
| 5317 | } |
| 5318 | |
| 5319 | // Find out whether a line ends or starts in a collapsed span. If |
| 5320 | // so, return the marker for that span. |
no test coverage detected