public static void register(@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);
    }
  }
public static void register(@Nullable Project project, @NotNull Editor editor, @NotNull JComponent component)