From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 5 Aug 2013 19:42:26 +0000 (+0200)
Subject: Fixed none working keybindings with <ctrl-x> whene x is a modkey.
X-Git-Url: https://git.owens.tech/dummy.html/dummy.html/git?a=commitdiff_plain;h=861421b01770c485a971f3a403b1b9163fa5e2be;p=vimb.git

Fixed none working keybindings with <ctrl-x> whene x is a modkey.

If a keybinding exists with a modekey 'x' no keybinding with 'x' and
additional modifiers worked.
---

diff --git a/src/keybind.c b/src/keybind.c
index 096c3e5..00c7879 100644
--- a/src/keybind.c
+++ b/src/keybind.c
@@ -254,6 +254,7 @@ static gboolean keypress_cb(WebKitWebView *webview, GdkEventKey *event)
 
         return true;
     }
+
     /* allow mode keys and counts only in normal mode and search mode */
     if (vb.state.mode & (VB_MODE_NORMAL|VB_MODE_SEARCH)) {
         if (vb.state.modkey == 0 && ((keyval >= GDK_1 && keyval <= GDK_9)
@@ -264,7 +265,10 @@ static gboolean keypress_cb(WebKitWebView *webview, GdkEventKey *event)
 
             return true;
         }
-        if (strchr(modkeys->str, keyval) && vb.state.modkey != keyval) {
+        /* modekeys don't have ctrl or mod modiefiers set */
+        if (!CLEAN_STATE(event)
+            && strchr(modkeys->str, keyval) && vb.state.modkey != keyval
+        ) {
             vb.state.modkey = (char)keyval;
             vb_update_statusbar();