private void onHighlighterChanged(@NotNull RangeHighlighterEx highlighter,
                                    boolean canImpactGutterSize, boolean fontStyleChanged, boolean foregroundColorChanged) {
    EdtInvocationManager.invokeLaterIfNeeded(() -> {
      if (isDisposed() || myDocument.isInBulkUpdate() || myInlayModel.isInBatchMode()) return; // will be repainted later

      if (canImpactGutterSize) {
        updateGutterSize();
      }

      if (myDocumentChangeInProgress) return;

      int textLength = myDocument.getTextLength();
      int start = MathUtil.clamp(highlighter.getAffectedAreaStartOffset(), 0, textLength);
      int end = MathUtil.clamp(highlighter.getAffectedAreaEndOffset(), start, textLength);

      if (myGutterComponent.getCurrentAccessibleLine() != null &&
          AccessibleGutterLine.isAccessibleGutterElement(highlighter.getGutterIconRenderer())) {
        escapeGutterAccessibleLine(start, end);
      }
      int startLine = myDocument.getLineNumber(start);
      int endLine = myDocument.getLineNumber(end);
      if (start != end && (fontStyleChanged || foregroundColorChanged)) {
        myView.invalidateRange(start, end, fontStyleChanged);
      }
      if (!myFoldingModel.isInBatchFoldingOperation()) { // at the end of the batch folding operation everything is repainted
        repaintLines(Math.max(0, startLine - 1), Math.min(endLine + 1, getDocument().getLineCount()));
      }

      updateCaretCursor();
    });
  }
private void onHighlighterChanged(@NotNull RangeHighlighterEx highlighter,
                                    boolean canImpactGutterSize, boolean fontStyleChanged, boolean foregroundColorChanged)