MCPcopy Index your code
hub / github.com/csev/py4e / markedSpansBefore

Function markedSpansBefore

tools/pythonauto/static/codemirrorepl/codemirror.js:5129–5139  ·  view source on GitHub ↗
(old, startCh, isInsert)

Source from the content-addressed store, hash-verified

5127 // character position, returning an array of remaining chunks (or
5128 // undefined if nothing remains).
5129 function markedSpansBefore(old, startCh, isInsert) {
5130 if (old) for (var i = 0, nw; i < old.length; ++i) {
5131 var span = old[i], marker = span.marker;
5132 var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
5133 if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
5134 var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
5135 (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
5136 }
5137 }
5138 return nw;
5139 }
5140 function markedSpansAfter(old, endCh, isInsert) {
5141 if (old) for (var i = 0, nw; i < old.length; ++i) {
5142 var span = old[i], marker = span.marker;

Callers 1

stretchSpansOverChangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected