private void beforeChangedUpdate(DocumentEvent event, DelayedExceptions exceptions) {
    Application app = ApplicationManager.getApplication();
    if (app != null) {
      FileDocumentManager manager = FileDocumentManager.getInstance();
      VirtualFile file = manager.getFile(this);
      if (file != null && !file.isValid()) {
        LOG.error("File of this document has been deleted: "+file);
      }
    }
    assertInsideCommand();

    getLineSet(); // initialize line set to track changed lines

    if (!ShutDownTracker.isShutdownHookRunning()) {
      DocumentListener[] listeners = getListeners();
      ProgressManager.getInstance().executeNonCancelableSection(() -> {
        for (int i = listeners.length - 1; i >= 0; i--) {
          try {
            listeners[i].beforeDocumentChange(event);
          }
          catch (Throwable e) {
            exceptions.register(e);
          }
        }
      });
    }

    myEventsHandling = true;
  }
private void beforeChangedUpdate(DocumentEvent event, DelayedExceptions exceptions)