void (final FileEditor editor, final boolean isUndo) { ClientState state = getClientState(editor); if (state == null) { return; } state.myCurrentOperationState = isUndo ? OperationState.UNDO : OperationState.REDO; try { final RuntimeException[] exception = new RuntimeException[1]; Runnable executeUndoOrRedoAction = () -> { 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 { state.myCurrentOperationState = OperationState.NONE; } }