[gtksourceview/wip/chergert/vim: 93/363] avoid processing release events as commands




commit 67c9cb5eb0c4ceebb35068270deeec5da8a98dad
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 27 13:12:14 2021 -0700

    avoid processing release events as commands

 gtksourceview/vim/gtk-source-vim-insert.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-insert.c b/gtksourceview/vim/gtk-source-vim-insert.c
index 28ba7165..54cee7e3 100644
--- a/gtksourceview/vim/gtk-source-vim-insert.c
+++ b/gtksourceview/vim/gtk-source-vim-insert.c
@@ -110,6 +110,10 @@ gtk_source_vim_insert_handle_event (GtkSourceVimState *state,
        if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
                return TRUE;
 
+       /* Only deal with presses after this */
+       if (gdk_event_get_event_type (event) != GDK_KEY_PRESS)
+               return TRUE;
+
        /* Leave insert mode if Escape/ctrl+[ was pressed */
        if (gtk_source_vim_state_is_escape (keyval, mods))
        {


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