[gtksourceview/wip/chergert/vim: 203/293] yank to unmamed register before deleting




commit b4578607f39ffd3280508709bcf5192d1da2de7d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Nov 2 11:06:45 2021 -0700

    yank to unmamed register before deleting

 gtksourceview/vim/gtk-source-vim-delete.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-delete.c b/gtksourceview/vim/gtk-source-vim-delete.c
index 60474fa4..c3b2d69e 100644
--- a/gtksourceview/vim/gtk-source-vim-delete.c
+++ b/gtksourceview/vim/gtk-source-vim-delete.c
@@ -27,6 +27,7 @@
 #include "gtksourceview.h"
 
 #include "gtk-source-vim-delete.h"
+#include "gtk-source-vim-registers.h"
 
 struct _GtkSourceVimDelete
 {
@@ -148,6 +149,11 @@ gtk_source_vim_delete_repeat (GtkSourceVimState *state)
                } while (--count > 0);
        }
 
+       /* Copy the deleted text to the unnamed register */
+       gtk_source_vim_registers_take (gtk_source_vim_state_get_registers (state),
+                                      NULL,
+                                      gtk_text_iter_get_slice (&insert, &selection));
+
        gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &insert, &selection);
 
        if (gtk_text_iter_ends_line (&insert) &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]