Don't reuse commit IDs for new commits after undo. Closes #1598.
This commit is contained in:
parent
95d773ebc9
commit
3154090d2f
1 changed files with 3 additions and 1 deletions
|
@ -270,7 +270,9 @@ void SubsController::SetFileName(agi::fs::path const& path) {
|
||||||
void SubsController::OnCommit(AssFileCommit c) {
|
void SubsController::OnCommit(AssFileCommit c) {
|
||||||
if (c.message.empty() && !undo_stack.empty()) return;
|
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
|
// Allow coalescing only if it's the last change and the file has not been
|
||||||
// saved since the last change
|
// 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) {
|
if (commit_id == *c.commit_id+1 && redo_stack.empty() && saved_commit_id+1 != commit_id && autosaved_commit_id+1 != commit_id) {
|
||||||
|
|
Loading…
Reference in a new issue