void (@NotNull DocumentEvent event) { if (!isValid()) return; long translatedRange = -1; LinesCols translatedLineCols = null; if (PersistentRangeMarkerUtil.shouldTranslateViaDiff(event, toScalarRange())) { Pair.NonNull<TextRange, LinesCols> translated = translateViaDiff((DocumentEventImpl)event, myLinesCols); translatedRange = translated == null ? -1 : TextRangeScalarUtil.toScalarRange(translated.first); translatedLineCols = Pair.getSecond(translated); } if (translatedRange == -1) { RangeMarkerTree.RMNode<RangeMarkerEx> node = myNode; translatedRange = node == null ? -1 : applyChange(event, node.toScalarRange(), isGreedyToLeft(), isGreedyToRight(), isStickingToRight()); if (translatedRange != -1) { translatedLineCols = storeLinesAndCols(event.getDocument(), translatedRange); } } if (translatedRange == -1 || translatedLineCols == null) { invalidate(); } else { setRange(translatedRange); myLinesCols = translatedLineCols; } }