[gtksourceview/wip/undo-redo: 1/3] UndoManager: improve doc



commit 4d0a27c0feeeb5d6b0cd96c7aab80de2831dd1cb
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Aug 22 18:03:06 2014 +0200

    UndoManager: improve doc

 gtksourceview/gtksourceundomanagerdefault.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourceundomanagerdefault.c b/gtksourceview/gtksourceundomanagerdefault.c
index f14e394..673a310 100644
--- a/gtksourceview/gtksourceundomanagerdefault.c
+++ b/gtksourceview/gtksourceundomanagerdefault.c
@@ -112,9 +112,23 @@ enum
 
 struct _GtkSourceUndoManagerDefaultPrivate
 {
+       /* Weak ref to the buffer. */
        GtkTextBuffer *buffer;
 
+       /* Array of GtkSourceUndoAction's. The most recent action is at the end
+        * of the array. But we can be in the middle of the array if there are
+        * redo actions on the right.
+        */
        GPtrArray *actions;
+
+       /* Index of the next redo action. Attention, the index is counted from
+        * the end of the array:
+        * - next_redo of -1: there is no redo actions.
+        * - next_redo of 0: there is one redo action, the last item in
+        *   'actions'.
+        * - next_redo of actions->len - 1: there is no undo actions, the next
+        *   redo action is the first item in 'actions'.
+        */
        gint next_redo;
 
        gint actions_in_current_group;
@@ -130,8 +144,9 @@ struct _GtkSourceUndoManagerDefaultPrivate
         */
        guint modified_undoing_group : 1;
 
-       /* Pointer to the action (in the action list) marked as "modified".
-        * It is NULL when no action is marked as "modified". */
+       /* Pointer to the action (in 'actions') marked as "modified".
+        * It is NULL when no action is marked as "modified".
+        */
        GtkSourceUndoAction *modified_action;
 };
 


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