[gtksourceview/wip/chergert/vim] dont allow going to line end
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] dont allow going to line end
- Date: Wed, 27 Oct 2021 19:55:13 +0000 (UTC)
commit 73cbf5d0a035b780cce82c52ac56ceb62a822778
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 27 12:55:00 2021 -0700
dont allow going to line end
gtksourceview/vim/gtk-source-vim-motion.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index 37b73392..e5fa1db2 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -553,8 +553,10 @@ motion_next_line_visual_column (GtkTextIter *iter,
column = gtk_source_view_get_visual_column (view, iter);
gtk_text_iter_set_line (iter, line + 1);
- if (!gtk_text_iter_ends_line (iter))
- get_iter_at_visual_column (view, iter, column);
+ get_iter_at_visual_column (view, iter, column);
+
+ if (!gtk_text_iter_starts_line (iter) && gtk_text_iter_ends_line (iter))
+ gtk_text_iter_backward_char (iter);
return !gtk_text_iter_equal (&before, iter);
}
@@ -577,6 +579,9 @@ motion_prev_line_visual_column (GtkTextIter *iter,
get_iter_at_visual_column (view, iter, column);
+ if (!gtk_text_iter_starts_line (iter) && gtk_text_iter_ends_line (iter))
+ gtk_text_iter_backward_char (iter);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]