MCPcopy
hub / github.com/witheve/Eve / markedSpansBefore

Function markedSpansBefore

src/codemirror.js:6362–6372  ·  view source on GitHub ↗
(old, startCh, isInsert)

Source from the content-addressed store, hash-verified

6360 // character position, returning an array of remaining chunks (or
6361 // undefined if nothing remains).
6362 function markedSpansBefore(old, startCh, isInsert) {
6363 if (old) for (var i = 0, nw; i < old.length; ++i) {
6364 var span = old[i], marker = span.marker;
6365 var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
6366 if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
6367 var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
6368 (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
6369 }
6370 }
6371 return nw;
6372 }
6373 function markedSpansAfter(old, endCh, isInsert) {
6374 if (old) for (var i = 0, nw; i < old.length; ++i) {
6375 var span = old[i], marker = span.marker;

Callers 1

stretchSpansOverChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected