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

Function markedSpansAfter

tools/pythonauto/static/codemirrorepl/codemirror.js:5140–5151  ·  view source on GitHub ↗
(old, endCh, isInsert)

Source from the content-addressed store, hash-verified

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;
5143 var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
5144 if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
5145 var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
5146 (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
5147 span.to == null ? null : span.to - endCh));
5148 }
5149 }
5150 return nw;
5151 }
5152
5153 // Given a change object, compute the new set of marker spans that
5154 // 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