void copyRangeMarkersTo(@NotNull DocumentImpl document, int tabSize) {
    List<RangeMarkerEx> oldMarkers = new ArrayList<>(size());
    processAll(r -> oldMarkers.add(r));
    for (RangeMarkerEx r : oldMarkers) {
      TextRange newRange = ((RangeMarkerImpl)r).reCalcTextRangeAfterReload(document, tabSize);
      RMNode<RangeMarkerEx> node = ((RangeMarkerImpl)r).myNode;
      if (node == null) continue;
      int startOffset = newRange.getStartOffset();
      int endOffset = newRange.getEndOffset();
      if (r.isValid() && TextRange.isProperRange(startOffset, endOffset) && endOffset <= document.getTextLength()) {
        document.registerRangeMarker(r, startOffset, endOffset, r.isGreedyToLeft(), r.isGreedyToRight(), 0);
      }
      else {
        node.invalidateUnderLock();
      }
    }
  }
void copyRangeMarkersTo(@NotNull DocumentImpl document, int tabSize)