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

Function collapsedSpanAround

external/.scrollLibs.js:1449–1461  ·  view source on GitHub ↗
(line, ch)

Source from the content-addressed store, hash-verified

1447 }
1448
1449 function collapsedSpanAround(line, ch) {
1450 var sps = sawCollapsedSpans && line.markedSpans,
1451 found
1452 if (sps) {
1453 for (var i = 0; i < sps.length; ++i) {
1454 var sp = sps[i]
1455 if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) {
1456 found = sp.marker
1457 }
1458 }
1459 }
1460 return found
1461 }
1462
1463 // Test whether there exists a collapsed span that partially
1464 // overlaps (covers the start or end, but not both) of a new span.

Callers 1

coordsCharFunction · 0.85

Calls 1

compareCollapsedMarkersFunction · 0.85

Tested by

no test coverage detected