From e4b2f1b509643568f94e84dde25289a8cefae996 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 19 Jan 2012 19:45:49 +0000 Subject: [PATCH] Set the minimum undo levels to 2, as things get weird without a valid undo stack Originally committed to SVN as r6315. --- aegisub/src/ass_file.cpp | 2 +- aegisub/src/preferences.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index e57716bd1..8ba8b8c97 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -654,7 +654,7 @@ int AssFile::Commit(wxString desc, int type, int amendId, AssEntry *single_line) UndoStack.push_back(*this); // Cap depth - int depth = OPT_GET("Limits/Undo Levels")->GetInt(); + int depth = std::max(OPT_GET("Limits/Undo Levels")->GetInt(), 2); while ((int)UndoStack.size() > depth) { UndoStack.pop_front(); } diff --git a/aegisub/src/preferences.cpp b/aegisub/src/preferences.cpp index 8dd137db4..3231a8767 100644 --- a/aegisub/src/preferences.cpp +++ b/aegisub/src/preferences.cpp @@ -111,7 +111,7 @@ General::General(wxTreebook *book, Preferences *parent): OptionPage(book, parent wxArrayString autoload_modes_arr(3, autoload_modes); OptionChoice(general, _("Automatically load linked files"), autoload_modes_arr, "App/Auto/Load Linked Files"); OptionAdd(general, _("Toolbar Icon Size"), "App/Toolbar Icon Size"); - OptionAdd(general, _("Undo Levels"), "Limits/Undo Levels"); + OptionAdd(general, _("Undo Levels"), "Limits/Undo Levels", 2); wxFlexGridSizer *recent = PageSizer(_("Recently Used Lists")); OptionAdd(recent, _("Files"), "Limits/MRU");