[gnome-builder/wip/vim] vim: don't allow delete `x` to jump past current line.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/vim] vim: don't allow delete `x` to jump past current line.
- Date: Tue, 30 Sep 2014 06:51:34 +0000 (UTC)
commit ecb9eb2e254d7b30a10906919d1f3111ffc73bde
Author: Christian Hergert <christian hergert me>
Date: Mon Sep 29 23:51:28 2014 -0700
vim: don't allow delete `x` to jump past current line.
src/editor/gb-editor-vim.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index eebe3fc..1ce34e7 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -480,11 +480,10 @@ gb_editor_vim_delete_selection (GbEditorVim *vim)
*/
if (gtk_text_iter_equal (&begin, &end))
{
- if (gtk_text_iter_starts_line (&begin) && gtk_text_iter_ends_line (&end))
- {
- if (!gtk_text_iter_forward_char (&end))
- gtk_text_iter_backward_char (&begin);
- }
+ if (gtk_text_iter_starts_line (&begin) &&
+ gtk_text_iter_ends_line (&end) &&
+ (0 == gtk_text_iter_get_line_offset (&end)))
+ return;
else if (!gtk_text_iter_ends_line (&end))
{
if (!gtk_text_iter_forward_char (&end))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]