public static void resetUndoRedoActions(@NotNull JTextComponent textComponent) {
    UndoManager undoManager = ClientProperty.get(textComponent, UNDO_MANAGER);
    if (undoManager != null) {
      undoManager.discardAllEdits();
    }
  }
public static void resetUndoRedoActions(@NotNull JTextComponent textComponent)