Don't reuse commit IDs for new commits after undo. Closes #1598.

This commit is contained in:
Thomas Goyne 2013-05-05 21:01:02 -07:00
parent 95d773ebc9
commit 3154090d2f

View file

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