[gnome-builder/wip/vim] vim: make delete selection match VIM for removing whole lines.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/vim] vim: make delete selection match VIM for removing whole lines.
- Date: Mon, 29 Sep 2014 23:14:04 +0000 (UTC)
commit e3bda9c301f15b1439c4790336524c22fd7e8fa0
Author: Christian Hergert <christian hergert me>
Date: Mon Sep 29 16:12:23 2014 -0700
vim: make delete selection match VIM for removing whole lines.
src/editor/gb-editor-vim.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 7328886..7cb2563 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -371,6 +371,13 @@ gb_editor_vim_delete_selection (GbEditorVim *vim)
return;
}
+ /*
+ * If this selection is an entire line, delete the trailing newline as
+ * VIM does in both `v` and `V` selection modes.
+ */
+ if (gtk_text_iter_starts_line (&begin) && gtk_text_iter_ends_line (&end))
+ gtk_text_iter_forward_char (&end);
+
gtk_text_buffer_begin_user_action (buffer);
gtk_text_buffer_delete (buffer, &begin, &end);
gtk_text_buffer_end_user_action (buffer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]