MCPcopy Create free account
hub / github.com/breck7/scroll / collapsedSpanAtSide

Function collapsedSpanAtSide

external/.scrollLibs.js:1429–1441  ·  view source on GitHub ↗
(line, start)

Source from the content-addressed store, hash-verified

1427 // Find out whether a line ends or starts in a collapsed span. If
1428 // so, return the marker for that span.
1429 function collapsedSpanAtSide(line, start) {
1430 var sps = sawCollapsedSpans && line.markedSpans,
1431 found
1432 if (sps) {
1433 for (var sp = void 0, i = 0; i < sps.length; ++i) {
1434 sp = sps[i]
1435 if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) {
1436 found = sp.marker
1437 }
1438 }
1439 }
1440 return found
1441 }
1442 function collapsedSpanAtStart(line) {
1443 return collapsedSpanAtSide(line, true)
1444 }

Callers 2

collapsedSpanAtStartFunction · 0.85
collapsedSpanAtEndFunction · 0.85

Calls 1

compareCollapsedMarkersFunction · 0.85

Tested by

no test coverage detected