MCPcopy Create free account
hub / github.com/TruthHun/BookStack / collapsedSpanAtSide

Function collapsedSpanAtSide

static/mergely/lib/codemirror.js:6530–6539  ·  view source on GitHub ↗
(line, start)

Source from the content-addressed store, hash-verified

6528 // Find out whether a line ends or starts in a collapsed span. If
6529 // so, return the marker for that span.
6530 function collapsedSpanAtSide(line, start) {
6531 var sps = sawCollapsedSpans && line.markedSpans, found;
6532 if (sps) for (var sp, i = 0; i < sps.length; ++i) {
6533 sp = sps[i];
6534 if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
6535 (!found || compareCollapsedMarkers(found, sp.marker) < 0))
6536 found = sp.marker;
6537 }
6538 return found;
6539 }
6540 function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }
6541 function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }
6542

Callers 2

collapsedSpanAtStartFunction · 0.70
collapsedSpanAtEndFunction · 0.70

Calls 1

compareCollapsedMarkersFunction · 0.70

Tested by

no test coverage detected