History should now behave properly..

Wed, 18 Dec 2013 19:39:55 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Wed, 18 Dec 2013 19:39:55 +0200
changeset 561
1d90296ad3fc
parent 560
39085791128f
child 562
c4ff45e98551

History should now behave properly..

src/gui.cc file | annotate | diff | comparison | revisions
src/history.cc file | annotate | diff | comparison | revisions
--- a/src/gui.cc	Wed Dec 18 17:44:31 2013 +0200
+++ b/src/gui.cc	Wed Dec 18 19:39:55 2013 +0200
@@ -876,6 +876,9 @@
 	// Update the list item of the current file - we may need to draw an icon
 	// now that marks it as having unsaved changes.
 	updateDocumentListItem (getCurrentDocument());
+
+	// We're done with the action, the history should stop ignoring now.
+	getCurrentDocument()->getHistory()->setIgnoring (false);
 }
 
 // =============================================================================
--- a/src/history.cc	Wed Dec 18 17:44:31 2013 +0200
+++ b/src/history.cc	Wed Dec 18 19:39:55 2013 +0200
@@ -43,7 +43,6 @@
 	// Iterate the list in reverse and undo all actions
 	for (int i = set.size() - 1; i >= 0; --i)
 	{	AbstractHistoryEntry* change = set[i];
-		dlog ("Undo change of type %1", change->getType());
 		change->undo();
 	}
 
@@ -55,6 +54,7 @@
 		g_win->doFullRefresh();
 
 	g_win->updateActions();
+	dlog ("Position is now %1", getPosition());
 }
 
 // =============================================================================
@@ -97,6 +97,7 @@
 {	if (m_currentChangeset.isEmpty())
 		return;
 
+	dlog ("position: %1, size: %2\n", getPosition(), getSize());
 	while (getPosition() < getSize() - 1)
 	{	Changeset last = m_changesets.last();
 
@@ -117,7 +118,8 @@
 // -----------------------------------------------------------------------------
 void History::add (AbstractHistoryEntry* entry)
 {	if (isIgnoring())
-	{	delete entry;
+	{	dlog ("Ignored addition of history entry of type %1", entry->getTypeName());
+		delete entry;
 		return;
 	}
 

mercurial