[gtksourceview/wip/chergert/vim] fix ctrl+u twice (or on line with just space)



commit bc8fc31597d7210dfe36334c54a0fb4cc005337d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 27 13:12:00 2021 -0700

    fix ctrl+u twice (or on line with just space)

 gtksourceview/vim/gtk-source-vim-insert.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-insert.c b/gtksourceview/vim/gtk-source-vim-insert.c
index a9d4d360..28ba7165 100644
--- a/gtksourceview/vim/gtk-source-vim-insert.c
+++ b/gtksourceview/vim/gtk-source-vim-insert.c
@@ -75,6 +75,11 @@ clear_to_first_char (GtkSourceVimInsert *self)
                gtk_text_iter_forward_char (&begin);
        }
 
+       if (gtk_text_iter_equal (&begin, &insert))
+       {
+               gtk_text_iter_set_line_offset (&begin, 0);
+       }
+
        gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &begin, &insert);
 
        return TRUE;


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