MCPcopy
hub / github.com/witheve/Eve / compareCollapsedMarkers

Function compareCollapsedMarkers

src/codemirror.js:6542–6551  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

6540 // spans is larger (and thus includes the other). Falls back to
6541 // comparing ids when the spans cover exactly the same range.
6542 function compareCollapsedMarkers(a, b) {
6543 var lenDiff = a.lines.length - b.lines.length;
6544 if (lenDiff != 0) return lenDiff;
6545 var aPos = a.find(), bPos = b.find();
6546 var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);
6547 if (fromCmp) return -fromCmp;
6548 var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);
6549 if (toCmp) return toCmp;
6550 return b.id - a.id;
6551 }
6552
6553 // Find out whether a line ends or starts in a collapsed span. If
6554 // so, return the marker for that span.

Callers 2

collapsedSpanAtSideFunction · 0.85
insertLineContentFunction · 0.85

Calls 3

extraLeftFunction · 0.85
extraRightFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected