]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0835: Motif: mapping <C-bslash> still doesn't work v8.2.0835
authorBram Moolenaar <Bram@vim.org>
Thu, 28 May 2020 19:03:53 +0000 (21:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 28 May 2020 19:03:53 +0000 (21:03 +0200)
Problem:    Motif: mapping <C-bslash> still doesn't work.
Solution:   Accept CSI for K_SPECIAL.  Do not apply CTRL to the character
            early.  (closes #6150)

src/getchar.c
src/gui_x11.c
src/version.c

index 8b417ecd19a066f9a56b5566e0330f94453ae6d0..e9eef25ad82884a7884928833df791c5f80d71a5 100644 (file)
@@ -2279,6 +2279,15 @@ handle_mapping(
                    || ((compl_cont_status & CONT_LOCAL)
                        && (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P))))
     {
+#ifdef FEAT_GUI
+       if (gui.in_use && tb_c1 == CSI && typebuf.tb_len >= 2
+               && typebuf.tb_buf[typebuf.tb_off + 1] == KS_MODIFIER)
+       {
+           // The GUI code sends CSI KS_MODIFIER {flags}, but mappings expect
+           // K_SPECIAL KS_MODIFIER {flags}.
+           tb_c1 = K_SPECIAL;
+       }
+#endif
 #ifdef FEAT_LANGMAP
        if (tb_c1 == K_SPECIAL)
            nolmaplen = 2;
@@ -2337,7 +2346,7 @@ handle_mapping(
                    if (mp->m_keys[mlen] != c2)
 #else
                    if (mp->m_keys[mlen] !=
-                       typebuf.tb_buf[typebuf.tb_off + mlen])
+                                        typebuf.tb_buf[typebuf.tb_off + mlen])
 #endif
                        break;
                }
index 1eec793e5a8e207ca00f983e4b5fef3e4448afc9..a64bc3bd9c7038d6ea3b683717769bc29b873ab7 100644 (file)
@@ -920,7 +920,12 @@ gui_x11_key_hit_cb(
     if (ev_press->state & ShiftMask)
        modifiers |= MOD_MASK_SHIFT;
     if (ev_press->state & ControlMask)
+    {
        modifiers |= MOD_MASK_CTRL;
+       if (len == 1 && string[0] < 0x20)
+           // Use the character before applyng CTRL.
+           string[0] += 0x40;
+    }
     if (ev_press->state & Mod1Mask)
        modifiers |= MOD_MASK_ALT;
     if (ev_press->state & Mod4Mask)
index 24a576724b66bd62cf363c6229c97710aed940d0..37b363e314566b48bdc3ee7d8ce3733f35406786 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    835,
 /**/
     834,
 /**/