[gtksourceview] vim: fix begin/end user action in replace mode



commit 77250bce165a57101805a569d5828d373c91b0b4
Author: Christian Hergert <chergert redhat com>
Date:   Mon Dec 13 22:19:16 2021 -0800

    vim: fix begin/end user action in replace mode
    
    This should have been handled in leave so that we leave the undo manager
    in consistent state.

 gtksourceview/vim/gtksourcevimreplace.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtksourceview/vim/gtksourcevimreplace.c b/gtksourceview/vim/gtksourcevimreplace.c
index fd78720b..310694de 100644
--- a/gtksourceview/vim/gtksourcevimreplace.c
+++ b/gtksourceview/vim/gtksourcevimreplace.c
@@ -102,15 +102,11 @@ gtk_source_vim_replace_enter (GtkSourceVimState *state)
 }
 
 static void
-gtk_source_vim_replace_resume (GtkSourceVimState *state,
-                               GtkSourceVimState *from)
+gtk_source_vim_replace_leave (GtkSourceVimState *state)
 {
        g_assert (GTK_SOURCE_IS_VIM_REPLACE (state));
-       g_assert (GTK_SOURCE_IS_VIM_STATE (from));
 
-       gtk_source_vim_state_set_overwrite (state, TRUE);
        gtk_source_vim_state_end_user_action (state);
-       gtk_source_vim_state_unparent (from);
 }
 
 static void
@@ -130,7 +126,7 @@ gtk_source_vim_replace_class_init (GtkSourceVimReplaceClass *klass)
        state_class->append_command = gtk_source_vim_replace_append_command;
        state_class->handle_keypress = gtk_source_vim_replace_handle_keypress;
        state_class->enter = gtk_source_vim_replace_enter;
-       state_class->resume = gtk_source_vim_replace_resume;
+       state_class->leave = gtk_source_vim_replace_leave;
 }
 
 static void


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