[gtksourceview/wip/chergert/vim] move state mods ignoring to vim state
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] move state mods ignoring to vim state
- Date: Sat, 30 Oct 2021 00:35:45 +0000 (UTC)
commit bcfc106ea37c21b1f0b540594a409990f7dc58c0
Author: Christian Hergert <chergert redhat com>
Date: Fri Oct 29 17:35:28 2021 -0700
move state mods ignoring to vim state
fixes yH and such
gtksourceview/vim/gtk-source-vim-normal.c | 33 -------------------------------
gtksourceview/vim/gtk-source-vim-state.c | 33 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 33 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index 2128fbcb..12f27d98 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -752,39 +752,6 @@ key_handler_initial (GtkSourceVimNormal *self,
{
g_assert (GTK_SOURCE_IS_VIM_NORMAL (self));
- /* Ignore shift/control/etc keyvals */
- switch (keyval)
- {
- case GDK_KEY_Shift_L:
- case GDK_KEY_Shift_R:
- case GDK_KEY_Shift_Lock:
- case GDK_KEY_Caps_Lock:
- case GDK_KEY_ISO_Lock:
- case GDK_KEY_Control_L:
- case GDK_KEY_Control_R:
- case GDK_KEY_Meta_L:
- case GDK_KEY_Meta_R:
- case GDK_KEY_Alt_L:
- case GDK_KEY_Alt_R:
- case GDK_KEY_Super_L:
- case GDK_KEY_Super_R:
- case GDK_KEY_Hyper_L:
- case GDK_KEY_Hyper_R:
- case GDK_KEY_ISO_Level3_Shift:
- case GDK_KEY_ISO_Next_Group:
- case GDK_KEY_ISO_Prev_Group:
- case GDK_KEY_ISO_First_Group:
- case GDK_KEY_ISO_Last_Group:
- case GDK_KEY_Mode_switch:
- case GDK_KEY_Num_Lock:
- case GDK_KEY_Multi_key:
- case GDK_KEY_Scroll_Lock:
- return FALSE;
-
- default:
- break;
- }
-
if ((mods & GDK_CONTROL_MASK) != 0)
{
switch (keyval)
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index 9d7798dc..aa17f49b 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -120,6 +120,39 @@ gtk_source_vim_state_real_handle_event (GtkSourceVimState *self,
return FALSE;
}
+ /* Ignore shift/control/etc keyvals */
+ switch (gdk_key_event_get_keyval (event))
+ {
+ case GDK_KEY_Shift_L:
+ case GDK_KEY_Shift_R:
+ case GDK_KEY_Shift_Lock:
+ case GDK_KEY_Caps_Lock:
+ case GDK_KEY_ISO_Lock:
+ case GDK_KEY_Control_L:
+ case GDK_KEY_Control_R:
+ case GDK_KEY_Meta_L:
+ case GDK_KEY_Meta_R:
+ case GDK_KEY_Alt_L:
+ case GDK_KEY_Alt_R:
+ case GDK_KEY_Super_L:
+ case GDK_KEY_Super_R:
+ case GDK_KEY_Hyper_L:
+ case GDK_KEY_Hyper_R:
+ case GDK_KEY_ISO_Level3_Shift:
+ case GDK_KEY_ISO_Next_Group:
+ case GDK_KEY_ISO_Prev_Group:
+ case GDK_KEY_ISO_First_Group:
+ case GDK_KEY_ISO_Last_Group:
+ case GDK_KEY_Mode_switch:
+ case GDK_KEY_Num_Lock:
+ case GDK_KEY_Multi_key:
+ case GDK_KEY_Scroll_Lock:
+ return FALSE;
+
+ default:
+ break;
+ }
+
if (GTK_SOURCE_VIM_STATE_GET_CLASS (self)->handle_keypress != NULL)
{
guint keyval;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]