[gtksourceview/wip/chergert/vim: 35/73] add overwrite helper




commit b3018fe3514e3da7d1033914302732747904d10f
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 22 11:24:38 2021 -0700

    add overwrite helper

 gtksourceview/vim/gtk-source-vim-state.c | 14 ++++++++++++++
 gtksourceview/vim/gtk-source-vim-state.h |  2 ++
 2 files changed, 16 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index 274db047..23337d59 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -439,3 +439,17 @@ gtk_source_vim_state_pop (GtkSourceVimState *self)
 
        g_object_unref (self);
 }
+
+void
+gtk_source_vim_state_set_overwrite (GtkSourceVimState *self,
+                                    gboolean           overwrite)
+{
+       GtkSourceVimStatePrivate *priv = gtk_source_vim_state_get_instance_private (self);
+
+       g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (self));
+
+       if (priv->view != NULL)
+       {
+               gtk_text_view_set_overwrite (GTK_TEXT_VIEW (priv->view), overwrite);
+       }
+}
diff --git a/gtksourceview/vim/gtk-source-vim-state.h b/gtksourceview/vim/gtk-source-vim-state.h
index 60146ec4..9ecf80b2 100644
--- a/gtksourceview/vim/gtk-source-vim-state.h
+++ b/gtksourceview/vim/gtk-source-vim-state.h
@@ -67,6 +67,8 @@ GtkSourceVimState *gtk_source_vim_state_get_root       (GtkSourceVimState *self)
 GtkSourceVimState *gtk_source_vim_state_get_parent     (GtkSourceVimState *self);
 gboolean           gtk_source_vim_state_handle_event   (GtkSourceVimState *self,
                                                         GdkEvent          *event);
+void               gtk_source_vim_state_set_overwrite  (GtkSourceVimState *self,
+                                                        gboolean           overwrite);
 gboolean           gtk_source_vim_state_get_can_repeat (GtkSourceVimState *self);
 void               gtk_source_vim_state_repeat         (GtkSourceVimState *self,
                                                         int                repeat);


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