[gtk/wip/chergert/undo-fixes: 1/2] texthistory: add barriers after final grouping




commit e90153982dda29b4f04670e719aad2f14ed64397
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 22 17:08:02 2021 -0700

    texthistory: add barriers after final grouping
    
    We don't want to allow new items to be grouped into a previous action
    group after the end_user_action() is called. This ensures that we add a
    barrier action in those conditions.
    
    Fixes #4276

 gtk/gtktexthistory.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtk/gtktexthistory.c b/gtk/gtktexthistory.c
index 61ccc33f08..3b9379ccc3 100644
--- a/gtk/gtktexthistory.c
+++ b/gtk/gtktexthistory.c
@@ -224,6 +224,12 @@ action_chain (Action   *action,
 
       if (other->kind == ACTION_KIND_BARRIER)
         {
+          /* If we're not in a user action, this barrier is meant to
+           * stop items from coallescing into this group.
+           */
+          if (!in_user_action && action->u.group.depth == 0)
+            return FALSE;
+
           action_free (other);
           return TRUE;
         }


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