[gtksourceview/wip/chergert/vim] fix end line motion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] fix end line motion
- Date: Thu, 28 Oct 2021 21:42:13 +0000 (UTC)
commit 3f4e7e0754a0556c3a285ea7e8eeeb0a1910bbcc
Author: Christian Hergert <chergert redhat com>
Date: Thu Oct 28 14:42:07 2021 -0700
fix end line motion
gtksourceview/vim/gtk-source-vim-motion.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index feb16447..899c50fb 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -1462,23 +1462,9 @@ gtk_source_vim_motion_new_forward_char (void)
}
static gboolean
-motion_forward_line_end (GtkTextIter *iter,
+motion_line_end_with_nl (GtkTextIter *iter,
GtkSourceVimMotion *self)
{
- /* this version does not try to stay off the \n char, it is
- * primarily used to do line selections like `S`, `3S`, etc.
- */
- if (gtk_text_iter_is_end (iter))
- return FALSE;
-
- if (gtk_text_iter_ends_line (iter))
- {
- gtk_text_iter_forward_char (iter);
-
- if (gtk_text_iter_ends_line (iter))
- return TRUE;
- }
-
return gtk_text_iter_forward_to_line_end (iter);
}
@@ -1488,7 +1474,7 @@ gtk_source_vim_motion_new_line_end_with_nl (void)
GtkSourceVimMotion *self;
self = g_object_new (GTK_SOURCE_TYPE_VIM_MOTION, NULL);
- self->motion = motion_forward_line_end;
+ self->motion = motion_line_end_with_nl;
self->inclusivity = EXCLUSIVE;
return GTK_SOURCE_VIM_STATE (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]