[gtksourceview/wip/chergert/vim] copy deleted text into current register from cip/etc
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] copy deleted text into current register from cip/etc
- Date: Sun, 7 Nov 2021 01:27:15 +0000 (UTC)
commit f981413919a92735248d5c36af4591884d453f82
Author: Christian Hergert <chergert redhat com>
Date: Sat Nov 6 18:27:10 2021 -0700
copy deleted text into current register from cip/etc
gtksourceview/vim/gtk-source-vim-insert.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-insert.c b/gtksourceview/vim/gtk-source-vim-insert.c
index 43986fe9..6d64d93d 100644
--- a/gtksourceview/vim/gtk-source-vim-insert.c
+++ b/gtksourceview/vim/gtk-source-vim-insert.c
@@ -251,7 +251,20 @@ gtk_source_vim_insert_prepare (GtkSourceVimInsert *self)
if (!gtk_text_iter_equal (&iter, &selection))
{
+ char *removed = gtk_text_iter_get_slice (&iter, &selection);
+
+ if (((self->text_object && gtk_source_vim_text_object_is_linewise (self->text_object)) ||
+ (self->motion && gtk_source_vim_motion_is_linewise (self->motion))))
+ {
+ char *tmp = removed;
+ removed = g_strdup_printf ("%s\n", tmp);
+ g_free (tmp);
+ }
+
+ gtk_source_vim_state_set_current_register_value (GTK_SOURCE_VIM_STATE (self), removed);
gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &iter, &selection);
+
+ g_free (removed);
}
if (self->suffix)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]