Set the minimum undo levels to 2, as things get weird without a valid undo stack

Originally committed to SVN as r6315.
This commit is contained in:
Thomas Goyne 2012-01-19 19:45:49 +00:00
parent c75fb1d069
commit e4b2f1b509
2 changed files with 2 additions and 2 deletions

View file

@ -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<int>(OPT_GET("Limits/Undo Levels")->GetInt(), 2);
while ((int)UndoStack.size() > depth) {
UndoStack.pop_front();
}

View file

@ -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");