private void undoOrRedo(final FileEditor editor, final boolean isUndo) {
    ClientState state = getClientState(editor);
    if (state == null) {
      return;
    }
    state.myCurrentOperationState = isUndo ? OperationState.UNDO : OperationState.REDO;
    Disposable disposable = Disposer.newDisposable();
    try {
      final RuntimeException[] exception = new RuntimeException[1];
      Runnable executeUndoOrRedoAction = () -> {
        ApplicationManager.getApplication().getMessageBus().syncPublisher(UndoRedoListener.Companion.getTOPIC()).undoRedoStarted(myProject, this, editor, isUndo, disposable);
        try {
          CopyPasteManager.getInstance().stopKillRings();
          state.myMerger.undoOrRedo(editor, isUndo);
        }
        catch (RuntimeException ex) {
          exception[0] = ex;
        }
      };
      String name = getUndoOrRedoActionNameAndDescription(editor, isUndoInProgress()).second;
      CommandProcessor.getInstance()
        .executeCommand(myProject, executeUndoOrRedoAction, name, null, state.myMerger.getUndoConfirmationPolicy());
      if (exception[0] != null) throw exception[0];
    }
    finally {
      Disposer.dispose(disposable);
      state.myCurrentOperationState = OperationState.NONE;
    }
  }
private void undoOrRedo(final FileEditor editor, final boolean isUndo)