mirror of https://github.com/odrling/Aegisub
Use splice rather than swaps to pop the undo stack
This commit is contained in:
parent
ff21670388
commit
9a347b0b29
|
@ -308,9 +308,7 @@ void SubsController::OnCommit(AssFileCommit c) {
|
||||||
void SubsController::Undo() {
|
void SubsController::Undo() {
|
||||||
if (undo_stack.size() <= 1) return;
|
if (undo_stack.size() <= 1) return;
|
||||||
|
|
||||||
redo_stack.emplace_back(AssFile(), undo_stack.back().undo_description, commit_id);
|
redo_stack.splice(redo_stack.end(), undo_stack, std::prev(undo_stack.end()));
|
||||||
context->ass->swap(redo_stack.back().file);
|
|
||||||
undo_stack.pop_back();
|
|
||||||
*context->ass = undo_stack.back().file;
|
*context->ass = undo_stack.back().file;
|
||||||
commit_id = undo_stack.back().commit_id;
|
commit_id = undo_stack.back().commit_id;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue