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

Function markedSpansAfter

static/mergely/lib/codemirror.js:6348–6359  ·  view source on GitHub ↗
(old, endCh, isInsert)

Source from the content-addressed store, hash-verified

6346 return nw;
6347 }
6348 function markedSpansAfter(old, endCh, isInsert) {
6349 if (old) for (var i = 0, nw; i < old.length; ++i) {
6350 var span = old[i], marker = span.marker;
6351 var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
6352 if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
6353 var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
6354 (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
6355 span.to == null ? null : span.to - endCh));
6356 }
6357 }
6358 return nw;
6359 }
6360
6361 // Given a change object, compute the new set of marker spans that
6362 // cover the line in which the change took place. Removes spans

Callers 1

stretchSpansOverChangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected