[gtk/wip/chergert/fix-3977] textbuffer: ensure user actions are propagated to history




commit 6179886b14eccd3034dc8121aac7b709aac073ec
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 26 10:11:33 2021 -0700

    textbuffer: ensure user actions are propagated to history
    
    This was an oversight when porting the GtkTextHistory into GTK. We simply
    need to bind the GtkTextBuffer action into the text history for grouping
    to work correctly.
    
    Fixes #3977

 gtk/gtktextbuffer.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 907955a64c..83fc009812 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4260,6 +4260,7 @@ gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer)
   if (buffer->priv->user_action_count == 1)
     {
       /* Outermost nested user action begin emits the signal */
+      gtk_text_history_begin_user_action (buffer->priv->history);
       g_signal_emit (buffer, signals[BEGIN_USER_ACTION], 0);
     }
 }
@@ -4286,6 +4287,7 @@ gtk_text_buffer_end_user_action (GtkTextBuffer *buffer)
     {
       /* Ended the outermost-nested user action end, so emit the signal */
       g_signal_emit (buffer, signals[END_USER_ACTION], 0);
+      gtk_text_history_end_user_action (buffer->priv->history);
     }
 }
 


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