1
0
forked from aniani/vim

patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work

Problem:    With modifyOtherKeys CTRL-^ doesn't work.
Solution:   Handle the exception.
This commit is contained in:
Bram Moolenaar
2019-11-21 23:24:00 +01:00
parent 556ae8ea28
commit 828ffd5963
3 changed files with 22 additions and 5 deletions

View File

@@ -1768,13 +1768,20 @@ 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)
{
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)
{

View File

@@ -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

View File

@@ -737,6 +737,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2333,
/**/
2332,
/**/