package seedu.toDoList.logic.commands;

import seedu.toDoList.commons.exceptions.StateLimitException;

//@@author A0146123R
/**
 * Undoes the most recent action (up to 10 times).
 */
public class UndoCommand extends Command {

    public static final String COMMAND_WORD = "undo";

    public static final String MESSAGE_UNDO_SUCCESS = "Undid the most recent action.\n%1$s";
    public static final String MESSAGE_UNDO_FAILED = "No command to undo.";

    @Override
    public CommandResult execute() {
        try {
            model.getPreviousState();
            return new CommandResult(MESSAGE_UNDO_SUCCESS);
        } catch (StateLimitException e) {
            indicateAttemptToExecuteIncorrectCommand();
            return new CommandResult(MESSAGE_UNDO_FAILED);
        }
    }

}
@@ -363,14 +363,8 @@
 ion.
-%5Cn%251$s
 %22;%0A 

Fix undo message.