summaryrefslogtreecommitdiff
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-21 23:24:00 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-21 23:24:00 +0100
commit828ffd596394f714270a01a55fc3f949a8bd9b35 (patch)
treebed4a6135c83477a62c792937cc0709eb05d0b96 /src/getchar.c
parent556ae8ea28b4e3e9fc47ad130795009a3080146e (diff)
downloadvim-git-828ffd596394f714270a01a55fc3f949a8bd9b35.tar.gz
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't workv8.1.2333
Problem: With modifyOtherKeys CTRL-^ doesn't work. Solution: Handle the exception.
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 31843f64b..475ee7efe 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1768,12 +1768,19 @@ vgetc(void)
{
// A modifier was not used for a mapping, apply it to ASCII
// keys. Shift would already have been applied.
- if ((mod_mask & MOD_MASK_CTRL)
- && ((c >= '`' && c <= 0x7f)
- || (c >= '@' && c <= '_')))
+ if (mod_mask & MOD_MASK_CTRL)
{
- c &= 0x1f;
- 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;
+ mod_mask &= ~MOD_MASK_CTRL;
+ }
}
if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
&& c >= 0 && c <= 127)