From 20a0343120e7cee1366d1cd74c14d53eb9d62f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= Date: Wed, 24 Nov 2021 15:48:55 +0100 Subject: [PATCH] vimode: fix escape not working when numlock is on It seems that GDK_MOD2_MASK isn't the right modifier to check for command pressed - its mapping is platform-specific and while this works on macOS, it has undesirable side-effects on linux. Use GDK_META_MASK instead which based on my testing seems to do the right thing both on macOS and linux. --- vimode/src/keypress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimode/src/keypress.c b/vimode/src/keypress.c index 66139a994..525c5ce36 100644 --- a/vimode/src/keypress.c +++ b/vimode/src/keypress.c @@ -26,7 +26,7 @@ KeyPress *kp_from_event_key(GdkEventKey *ev) KeyPress *kp; /* ignore keypresses containing Alt and Command on macOS - no Vim command uses them */ - if (ev->state & (GDK_MOD1_MASK | GDK_MOD2_MASK)) + if (ev->state & (GDK_MOD1_MASK | GDK_META_MASK)) return NULL; switch (ev->keyval)