[Xfce4-commits] <xfce4-notes-plugin:master> Fix undo feature

Mike Massonnet noreply at xfce.org
Tue Mar 16 01:44:01 CET 2010


Updating branch refs/heads/master
         to 6021016e4b245a438f3a225fec336646942483ef (commit)
       from a78c54047b88f5c7162fe6e6dac0e3a7e9a6bfad (commit)

commit 6021016e4b245a438f3a225fec336646942483ef
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Tue Mar 16 01:39:27 2010 +0100

    Fix undo feature

 ChangeLog              |    8 ++++++++
 lib/hypertextview.vala |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dea7faa..307ad9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-16  Mike Massonnet <mmassonnet at xfce.org>
+
+Fix undo feature
+
+The undo timeout id wasn't reset to 0 which made the undo action think there
+was still a need to make a snapshot, and every time one hit the undo action it
+simply took a new snapshot and the undo/redo buffers ended the same.
+
 2010-03-15  Mike Massonnet <mmassonnet at xfce.org>
 
 Set tooltip for title bar buttons
diff --git a/lib/hypertextview.vala b/lib/hypertextview.vala
index 03ef216..83fc0f6 100644
--- a/lib/hypertextview.vala
+++ b/lib/hypertextview.vala
@@ -320,6 +320,11 @@ namespace Xnp {
 			this.undo_text = this.redo_text;
 			this.redo_text = this.buffer.get_text (start, end, false);
 
+			if (this.undo_timeout > 0) {
+				Source.remove (this.undo_timeout);
+				this.undo_timeout = 0;
+			}
+
 			return false;
 		}
 



More information about the Xfce4-commits mailing list