void repaint(int startOffset, int endOffset, boolean invalidateTextLayout) {
    if (myDocument.isInBulkUpdate() || myInlayModel.isInBatchMode()) {
      return;
    }
    if (myView == null) {
      // repaint may be called from EditorImpl.<init> IDEA-341841
      return;
    }
    assertIsDispatchThread();
    ReadAction.run(() -> {
      int minEndOffset = Math.min(endOffset, myDocument.getTextLength());

      if (invalidateTextLayout) {
        myView.invalidateRange(startOffset, minEndOffset, true);
      }

      if (!isShowing()) {
        return;
      }

      if (myDocumentChangeInProgress) {
        // at this point soft wrap model might be in an invalid state, so the following calculations cannot be performed correctly
        if (startOffset < myRangeToRepaintStart) myRangeToRepaintStart = startOffset;
        if (minEndOffset > myRangeToRepaintEnd) myRangeToRepaintEnd = minEndOffset;
        return;
      }

      // We do repaint in case of equal offsets. There is a possible case that there is a soft wrap at the same offset,
      // and it does occupy a particular amount of visual space that may be necessary to repaint.
      if (startOffset <= minEndOffset) {
        int startLine = myView.offsetToVisualLine(startOffset, false);
        int endLine = myView.offsetToVisualLine(minEndOffset, true);
        doRepaint(startLine, endLine);
      }
    });
  }
void repaint(int startOffset, int endOffset, boolean invalidateTextLayout)