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

Function markedSpansBefore

static/mergely/lib/codemirror.js:6337–6347  ·  view source on GitHub ↗
(old, startCh, isInsert)

Source from the content-addressed store, hash-verified

6335 // character position, returning an array of remaining chunks (or
6336 // undefined if nothing remains).
6337 function markedSpansBefore(old, startCh, isInsert) {
6338 if (old) for (var i = 0, nw; i < old.length; ++i) {
6339 var span = old[i], marker = span.marker;
6340 var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
6341 if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
6342 var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
6343 (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
6344 }
6345 }
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;

Callers 1

stretchSpansOverChangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected