From 3154090d2f65b50ce5d0ecfc4985ce05090d6db0 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 5 May 2013 21:01:02 -0700 Subject: [PATCH] Don't reuse commit IDs for new commits after undo. Closes #1598. --- aegisub/src/subs_controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/src/subs_controller.cpp b/aegisub/src/subs_controller.cpp index fd35d0070..c40cb70be 100644 --- a/aegisub/src/subs_controller.cpp +++ b/aegisub/src/subs_controller.cpp @@ -270,7 +270,9 @@ void SubsController::SetFileName(agi::fs::path const& path) { void SubsController::OnCommit(AssFileCommit c) { if (c.message.empty() && !undo_stack.empty()) return; - ++commit_id; + static int next_commit_id = 1; + + commit_id = next_commit_id++; // Allow coalescing only if it's the last change and the file has not been // saved since the last change if (commit_id == *c.commit_id+1 && redo_stack.empty() && saved_commit_id+1 != commit_id && autosaved_commit_id+1 != commit_id) {