void (@Nullable Project project, @NotNull Editor editor, @NotNull JComponent component) { UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance(); TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(editor); if (undoManager != null) { DiffUtil.registerAction(new ProxyUndoRedoAction(undoManager, textEditor, true), component); DiffUtil.registerAction(new ProxyUndoRedoAction(undoManager, textEditor, false), component); } }