diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-05-28 21:03:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-05-28 21:03:53 +0200 |
commit | c998370562425e70f4cf202a87112d638f5f7b38 (patch) | |
tree | 315f060fadcc025a0201bf7bd2432e1221000f32 /src | |
parent | 3f65c66df95445ef84f98de007c9b70ce23f54a0 (diff) | |
download | vim-git-c998370562425e70f4cf202a87112d638f5f7b38.tar.gz |
patch 8.2.0835: Motif: mapping <C-bslash> still doesn't workv8.2.0835
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/getchar.c | 11 | ||||
-rw-r--r-- | src/gui_x11.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c index 8b417ecd1..e9eef25ad 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; } diff --git a/src/gui_x11.c b/src/gui_x11.c index 1eec793e5..a64bc3bd9 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -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) diff --git a/src/version.c b/src/version.c index 24a576724..37b363e31 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 835, +/**/ 834, /**/ 833, |