[gtksourceview/wip/chergert/vim] add user action helper



commit 17454b344540d9199e418e9b35254e01fd82afbd
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 29 12:39:17 2021 -0700

    add user action helper

 gtksourceview/vim/gtk-source-vim-state.c | 22 ++++++++++++++++++++++
 gtksourceview/vim/gtk-source-vim-state.h |  2 ++
 2 files changed, 24 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index f491d5d7..66ae9b8d 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -818,3 +818,25 @@ gtk_source_vim_state_get_count_set (GtkSourceVimState *self)
 
        return priv->count_set;
 }
+
+void
+gtk_source_vim_state_begin_user_action (GtkSourceVimState *self)
+{
+       GtkSourceBuffer *buffer;
+
+       g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (self));
+
+       buffer = gtk_source_vim_state_get_buffer (self, NULL, NULL);
+       gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (buffer));
+}
+
+void
+gtk_source_vim_state_end_user_action (GtkSourceVimState *self)
+{
+       GtkSourceBuffer *buffer;
+
+       g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (self));
+
+       buffer = gtk_source_vim_state_get_buffer (self, NULL, NULL);
+       gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (buffer));
+}
diff --git a/gtksourceview/vim/gtk-source-vim-state.h b/gtksourceview/vim/gtk-source-vim-state.h
index d0f591d5..fdfb67d6 100644
--- a/gtksourceview/vim/gtk-source-vim-state.h
+++ b/gtksourceview/vim/gtk-source-vim-state.h
@@ -77,6 +77,8 @@ int                gtk_source_vim_state_get_count             (GtkSourceVimState
 gboolean           gtk_source_vim_state_get_count_set         (GtkSourceVimState *self);
 void               gtk_source_vim_state_set_count             (GtkSourceVimState *self,
                                                                int                count);
+void               gtk_source_vim_state_begin_user_action     (GtkSourceVimState *self);
+void               gtk_source_vim_state_end_user_action       (GtkSourceVimState *self);
 gboolean           gtk_source_vim_state_handle_event          (GtkSourceVimState *self,
                                                                GdkEvent          *event);
 void               gtk_source_vim_state_set_overwrite         (GtkSourceVimState *self,


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