summaryrefslogtreecommitdiffstats
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
parent556ae8ea28b4e3e9fc47ad130795009a3080146e (diff)
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't workv8.1.2333
Problem: With modifyOtherKeys CTRL-^ doesn't work. Solution: Handle the exception.
-rw-r--r--src/getchar.c17
-rw-r--r--src/testdir/test_termcodes.vim8
-rw-r--r--src/version.c2
3 files changed, 22 insertions, 5 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 31843f64b1..475ee7efe7 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)
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim
index 6f8c8c074f..2678dae292 100644
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -1192,6 +1192,14 @@ func RunTest_modifyOtherKeys(func)
call feedkeys('a' .. a:func('X', 9) .. "\<Esc>", 'Lx!')
call assert_equal("Ø", getline(1))
+ " Ctrl-6 is Ctrl-^
+ split aaa
+ edit bbb
+ call feedkeys(a:func('6', 5), 'Lx!')
+ call assert_equal("aaa", bufname())
+ bwipe aaa
+ bwipe bbb
+
bwipe!
set timeoutlen&
endfunc
diff --git a/src/version.c b/src/version.c
index 0fa2f7d852..903734998d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2333,
+/**/
2332,
/**/
2331,