void (@NotNull Document beforeReformat) { myPreviewRangesToHighlight.clear(); MarkupModel markupModel = myEditor.getMarkupModel(); markupModel.removeAllHighlighters(); myPreviewRangesToHighlight.addAll(ChangesDiffCalculator.calculateDiff(beforeReformat, myEditor.getDocument())); if (!myPreviewRangesToHighlight.isEmpty()) { myEndHighlightPreviewChangesTimeMillis = System.currentTimeMillis() + TIME_TO_HIGHLIGHT_PREVIEW_CHANGES_IN_MILLIS; myShowsPreviewHighlighters = true; } }