[gnome-builder/wip/vim] vim: preserve selection upon `G` command.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/vim] vim: preserve selection upon `G` command.
- Date: Tue, 30 Sep 2014 23:04:57 +0000 (UTC)
commit 2999978a8879c92f7d612a94c44abde9945f6897
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 30 15:58:13 2014 -0700
vim: preserve selection upon `G` command.
src/editor/gb-editor-vim.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 2585342..9be1149 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -1017,12 +1017,20 @@ gb_editor_vim_move_to_end (GbEditorVim *vim)
GtkTextBuffer *buffer;
GtkTextMark *insert;
GtkTextIter iter;
+ GtkTextIter selection;
+ gboolean has_selection;
g_return_if_fail (GB_IS_EDITOR_VIM (vim));
buffer = gtk_text_view_get_buffer (vim->priv->text_view);
+ has_selection = gb_editor_vim_get_selection_bounds (vim, &iter, &selection);
+
gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_buffer_select_range (buffer, &iter, &iter);
+
+ if (has_selection)
+ gb_editor_vim_select_range (vim, &iter, &selection);
+ else
+ gtk_text_buffer_select_range (buffer, &iter, &iter);
insert = gtk_text_buffer_get_insert (buffer);
gtk_text_view_scroll_mark_onscreen (vim->priv->text_view, insert);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]