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) {