1
0
Fork 0

Make next_commit_id a member variable rather than a static

Multiple instances of SubsController should not share it.
This commit is contained in:
Thomas Goyne 2015-09-27 18:18:43 -07:00
parent 2032ab8ea3
commit 52dbb482af
2 changed files with 4 additions and 2 deletions

View File

@ -310,8 +310,6 @@ void SubsController::SetFileName(agi::fs::path const& path) {
void SubsController::OnCommit(AssFileCommit c) {
if (c.message.empty() && !undo_stack.empty()) return;
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

View File

@ -48,6 +48,10 @@ class SubsController {
int saved_commit_id = 0;
/// Last autosaved version of this file
int autosaved_commit_id = 0;
/// Version to use for the next commit
/// Needed to handle Save -> Undo -> Edit, which would result in the file
/// being marked unmodified if we reused commit IDs
int next_commit_id = 1;
/// Timer for triggering autosaves
wxTimer autosave_timer;