void (@NotNull RangeHighlighterEx highlighter, boolean renderersChanged) { if (myDocument.isInBulkUpdate()) return; // bulkUpdateFinished() will repaint anything if (myUseNewRendering && renderersChanged) { updateGutterSize(); } boolean errorStripeNeedsRepaint = renderersChanged || highlighter.getErrorStripeMarkColor() != null; if (myUseNewRendering && myDocumentChangeInProgress) { // postpone repaint request, as folding model can be in inconsistent state and so coordinate // conversions might give incorrect results myErrorStripeNeedsRepaint |= errorStripeNeedsRepaint; return; } int textLength = myDocument.getTextLength(); clearTextWidthCache(); int start = Math.min(Math.max(highlighter.getAffectedAreaStartOffset(), 0), textLength); int end = Math.min(Math.max(highlighter.getAffectedAreaEndOffset(), 0), textLength); int startLine = start == -1 ? 0 : myDocument.getLineNumber(start); int endLine = end == -1 ? myDocument.getLineCount() : myDocument.getLineNumber(end); TextAttributes attributes = highlighter.getTextAttributes(); if (myUseNewRendering && start != end && attributes != null && attributes.getFontType() != Font.PLAIN) { myView.invalidateRange(start, end); } repaintLines(Math.max(0, startLine - 1), Math.min(endLine + 1, getDocument().getLineCount())); // optimization: there is no need to repaint error stripe if the highlighter is invisible on it if (errorStripeNeedsRepaint) { ((EditorMarkupModelImpl)getMarkupModel()).repaint(start, end); } if (!myUseNewRendering && renderersChanged) { updateGutterSize(); } updateCaretCursor(); }