[gtksourceview/wip/chergert/vim] make motions a child of chained motion



commit 85674a311797e083e9bd2e49dae02cbe0b8e2b11
Author: Christian Hergert <chergert redhat com>
Date:   Sun Oct 31 12:07:07 2021 -0700

    make motions a child of chained motion

 gtksourceview/vim/gtk-source-vim-motion.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index bcc5230b..1251e65c 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -1787,6 +1787,9 @@ gtk_source_vim_motion_chain (GtkSourceVimMotion *self,
 
                g_ptr_array_add (self->chained, g_object_ref (other));
 
+               gtk_source_vim_state_set_parent (GTK_SOURCE_VIM_STATE (other),
+                                                GTK_SOURCE_VIM_STATE (self));
+
                return g_object_ref (GTK_SOURCE_VIM_STATE (self));
        }
 
@@ -1811,5 +1814,10 @@ gtk_source_vim_motion_chain (GtkSourceVimMotion *self,
        g_ptr_array_add (chained->chained, g_object_ref (self));
        g_ptr_array_add (chained->chained, g_object_ref (other));
 
+       gtk_source_vim_state_set_parent (GTK_SOURCE_VIM_STATE (self),
+                                        GTK_SOURCE_VIM_STATE (chained));
+       gtk_source_vim_state_set_parent (GTK_SOURCE_VIM_STATE (other),
+                                        GTK_SOURCE_VIM_STATE (chained));
+
        return GTK_SOURCE_VIM_STATE (chained);
 }


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