public @Nullable ManualRangeMarker getUpdatedRange(@NotNull DocumentEvent event, @NotNull FrozenDocument documentBefore) {
    if (mySurviveOnExternalChange && PersistentRangeMarkerUtil.shouldTranslateViaDiff(event, myRange)) {
      PersistentRangeMarker.LinesCols linesCols = myLinesCols != null ? myLinesCols
                                                                      : PersistentRangeMarker.storeLinesAndCols(documentBefore, myRange);
      Pair<TextRange, PersistentRangeMarker.LinesCols> pair =
        linesCols == null ? null : PersistentRangeMarker.translateViaDiff((DocumentEventImpl)event, linesCols);
      if (pair != null) {
        return new ManualRangeMarker(pair.first.getStartOffset(), pair.first.getEndOffset(), myGreedyLeft, myGreedyRight, true, pair.second);
      }
    }

    long newRange = RangeMarkerImpl.applyChange(event, myRange, myGreedyLeft, myGreedyRight, false);
    if (newRange == -1) return null;

    int delta = 0;
    if (DocumentEventUtil.isMoveInsertion(event)) {
      int srcOffset = event.getMoveOffset();
      if (srcOffset <= TextRangeScalarUtil.startOffset(newRange) && TextRangeScalarUtil.endOffset(newRange) <= srcOffset + event.getNewLength()) {
        delta = event.getOffset() - srcOffset;
      }
    }
    return new ManualRangeMarker(TextRangeScalarUtil.startOffset(newRange) + delta, TextRangeScalarUtil.endOffset(newRange) + delta, myGreedyLeft, myGreedyRight,
                                 mySurviveOnExternalChange, null);
  }
public @Nullable ManualRangeMarker getUpdatedRange(@NotNull DocumentEvent event, @NotNull FrozenDocument documentBefore)