From 64cd451def672f035d154fa4de3d97f9c4b1c91f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 21 May 2021 18:14:59 -0700 Subject: [PATCH] UI: Do not allow new undo actions while undo disabled --- UI/undo-stack-obs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UI/undo-stack-obs.cpp b/UI/undo-stack-obs.cpp index eed29cbb2..1b0d7cc0f 100644 --- a/UI/undo-stack-obs.cpp +++ b/UI/undo-stack-obs.cpp @@ -34,6 +34,9 @@ void undo_stack::add_action(const QString &name, undo_redo_cb undo, undo_redo_cb redo, std::string undo_data, std::string redo_data, bool repeatable) { + if (!is_enabled()) + return; + while (undo_items.size() >= MAX_STACK_SIZE) { undo_redo_t item = undo_items.back(); undo_items.pop_back();