[gtksourceview/wip/chergert/vim] add none motion



commit bd42bc9c154d5d7e5f974354bec0da1101c2ca8e
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 27 07:49:03 2021 -0700

    add none motion

 gtksourceview/vim/gtk-source-vim-motion.c | 18 ++++++++++++++++++
 gtksourceview/vim/gtk-source-vim-motion.h |  1 +
 2 files changed, 19 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index 3f3bf38d..47259608 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -68,6 +68,13 @@ line_is_empty (GtkTextIter *iter)
        return gtk_text_iter_starts_line (iter) && gtk_text_iter_ends_line (iter);
 }
 
+static gboolean
+motion_none (GtkTextIter        *iter,
+             GtkSourceVimMotion *self)
+{
+       return TRUE;
+}
+
 enum
 {
        CLASS_0,
@@ -1330,3 +1337,14 @@ gtk_source_vim_motion_new_line_end (void)
 
        return GTK_SOURCE_VIM_STATE (self);
 }
+
+GtkSourceVimState *
+gtk_source_vim_motion_new_none (void)
+{
+       GtkSourceVimMotion *self;
+
+       self = g_object_new (GTK_SOURCE_TYPE_VIM_MOTION, NULL);
+       self->motion = motion_none;
+
+       return GTK_SOURCE_VIM_STATE (self);
+}
diff --git a/gtksourceview/vim/gtk-source-vim-motion.h b/gtksourceview/vim/gtk-source-vim-motion.h
index 62690952..3ba06684 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.h
+++ b/gtksourceview/vim/gtk-source-vim-motion.h
@@ -32,6 +32,7 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (GtkSourceVimMotion, gtk_source_vim_motion, GTK_SOURCE, VIM_MOTION, GtkSourceVimState)
 
 GtkSourceVimState *gtk_source_vim_motion_new                 (void);
+GtkSourceVimState *gtk_source_vim_motion_new_none            (void);
 GtkSourceVimState *gtk_source_vim_motion_new_first_char      (void);
 GtkSourceVimState *gtk_source_vim_motion_new_line_end        (void);
 void               gtk_source_vim_motion_set_apply_on_leave  (GtkSourceVimMotion *self,


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