Code Duplication    Length = 11-12 lines in 2 locations

public/lib/CodeMirror/lib/codemirror.js 2 locations

@@ 6260-6271 (lines=12) @@
6257
    }
6258
    return nw;
6259
  }
6260
  function markedSpansAfter(old, endCh, isInsert) {
6261
    if (old) for (var i = 0, nw; i < old.length; ++i) {
6262
      var span = old[i], marker = span.marker;
6263
      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
6264
      if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
6265
        var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
6266
        (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
6267
                                              span.to == null ? null : span.to - endCh));
6268
      }
6269
    }
6270
    return nw;
6271
  }
6272
6273
  // Given a change object, compute the new set of marker spans that
6274
  // cover the line in which the change took place. Removes spans
@@ 6249-6259 (lines=11) @@
6246
  // document. These functions cut an array of spans at a given
6247
  // character position, returning an array of remaining chunks (or
6248
  // undefined if nothing remains).
6249
  function markedSpansBefore(old, startCh, isInsert) {
6250
    if (old) for (var i = 0, nw; i < old.length; ++i) {
6251
      var span = old[i], marker = span.marker;
6252
      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
6253
      if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
6254
        var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
6255
        (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
6256
      }
6257
    }
6258
    return nw;
6259
  }
6260
  function markedSpansAfter(old, endCh, isInsert) {
6261
    if (old) for (var i = 0, nw; i < old.length; ++i) {
6262
      var span = old[i], marker = span.marker;