summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-30 19:52:46 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-30 19:52:46 +0200
commitf4ae6b245a54f11dd967d06b80f30e5abf55fb82 (patch)
tree2168d44f4056abd29debc3939158f31add0bf3e0 /src/getchar.c
parent95da136142628e06425f9d9eb2d1ca56a9e48feb (diff)
patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUIv8.2.0851
Problem: Can't distinguish <M-a> from accented "a" in the GUI. Solution: Use another way to make mapping <C-bslash> work. (closes #6163)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 312f3c1db7..ace56863e7 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1593,16 +1593,26 @@ merge_modifyOtherKeys(int c_arg)
if (mod_mask & MOD_MASK_CTRL)
{
if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_'))
- {
c &= 0x1f;
- mod_mask &= ~MOD_MASK_CTRL;
- }
else if (c == '6')
- {
// CTRL-6 is equivalent to CTRL-^
c = 0x1e;
+#ifdef FEAT_GUI_GTK
+ // These mappings look arbitrary at the first glance, but in fact
+ // resemble quite exactly the behaviour of the GTK+ 1.2 GUI on my
+ // machine. The only difference is BS vs. DEL for CTRL-8 (makes
+ // more sense and is consistent with usual terminal behaviour).
+ else if (c == '2')
+ c = NUL;
+ else if (c >= '3' && c <= '7')
+ c = c ^ 0x28;
+ else if (c == '8')
+ c = BS;
+ else if (c == '?')
+ c = DEL;
+#endif
+ if (c != c_arg)
mod_mask &= ~MOD_MASK_CTRL;
- }
}
if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
&& c >= 0 && c <= 127)