[gtksourceview/wip/chergert/vim] stub out paragraph/sentence motion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] stub out paragraph/sentence motion
- Date: Sat, 23 Oct 2021 23:08:18 +0000 (UTC)
commit 7e36ddd7f22ce56f626e48134c4f4ce5d69e507b
Author: Christian Hergert <chergert redhat com>
Date: Sat Oct 23 16:08:13 2021 -0700
stub out paragraph/sentence motion
gtksourceview/vim/gtk-source-vim-motion.c | 42 +++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index abcc6fd7..4405a180 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -708,6 +708,34 @@ motion_F_char (GtkTextIter *iter,
return FALSE;
}
+static gboolean
+motion_forward_sentence_start (GtkTextIter *iter,
+ GtkSourceVimMotion *state)
+{
+ return FALSE;
+}
+
+static gboolean
+motion_backward_sentence_start (GtkTextIter *iter,
+ GtkSourceVimMotion *state)
+{
+ return FALSE;
+}
+
+static gboolean
+motion_forward_paragraph_start (GtkTextIter *iter,
+ GtkSourceVimMotion *state)
+{
+ return FALSE;
+}
+
+static gboolean
+motion_backward_paragraph_start (GtkTextIter *iter,
+ GtkSourceVimMotion *state)
+{
+ return FALSE;
+}
+
GtkSourceVimState *
gtk_source_vim_motion_new (void)
{
@@ -888,10 +916,20 @@ gtk_source_vim_motion_handle_keypress (GtkSourceVimState *state,
self->motion = motion_F_char;
return TRUE;
- case GDK_KEY_n:
- case GDK_KEY_N:
case GDK_KEY_parenleft:
+ return gtk_source_vim_motion_complete (self, motion_backward_sentence_start);
+
case GDK_KEY_parenright:
+ return gtk_source_vim_motion_complete (self, motion_forward_sentence_start);
+
+ case GDK_KEY_braceleft:
+ return gtk_source_vim_motion_complete (self, motion_backward_paragraph_start);
+
+ case GDK_KEY_braceright:
+ return gtk_source_vim_motion_complete (self, motion_forward_paragraph_start);
+
+ case GDK_KEY_n:
+ case GDK_KEY_N:
case GDK_KEY_percent:
/* TODO */
G_GNUC_FALLTHROUGH;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]