[anjuta] sourceview: don't emit change events after doing an undo



commit 5728cc2cb6f587bbe9c86c1a0d779e6ad03e794b
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Thu Oct 4 01:01:04 2012 +0200

    sourceview: don't emit change events after doing an undo
    
    This fixes an issue where the indentation plugin would do stuff based on the inserted text from
    the undo. This would in turn break the expectation that the text will be the same as it were
    after the undo.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687216

 plugins/sourceview/sourceview.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index 19b18a0..4683973 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -1478,8 +1478,14 @@ static void
 idocument_undo(IAnjutaDocument* edit, GError** ee)
 {
 	Sourceview* sv = ANJUTA_SOURCEVIEW(edit);
+	
 	if (idocument_can_undo(edit, NULL))
+	{
+		g_signal_handlers_block_by_func (sv->priv->document, on_insert_text, sv);
 		gtk_source_buffer_undo(GTK_SOURCE_BUFFER(sv->priv->document));
+		g_signal_handlers_unblock_by_func (sv->priv->document, on_insert_text, sv);
+	}
+	
 	anjuta_view_scroll_to_cursor(sv->priv->view);
 	g_signal_emit_by_name(G_OBJECT(sv), "update_ui", sv);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]