0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.2135: with modifyOtherKeys Alt-a does not work properly

Problem:    With modifyOtherKeys Alt-a does not work properly.
Solution:   Remove the ALT modifier.  Get multi-byte after applying ALT.
This commit is contained in:
Bram Moolenaar 2019-10-10 21:49:28 +02:00
parent 6a0299d8f4
commit 00eab7f128
2 changed files with 21 additions and 19 deletions

View File

@ -1733,25 +1733,6 @@ vgetc(void)
case K_XRIGHT: c = K_RIGHT; break;
}
if (!no_reduce_keys)
{
// A modifier was not used for a mapping, apply it to ASCII
// keys.
if ((mod_mask & MOD_MASK_CTRL)
&& ((c >= '`' && c <= 0x7f)
|| (c >= '@' && c <= '_')))
{
c &= 0x1f;
mod_mask &= ~MOD_MASK_CTRL;
}
if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
&& c >= 0 && c <= 127)
{
c += 0x80;
mod_mask &= ~MOD_MASK_META;
}
}
// For a multi-byte character get all the bytes and return the
// converted character.
// Note: This will loop until enough bytes are received!
@ -1787,6 +1768,25 @@ vgetc(void)
c = (*mb_ptr2char)(buf);
}
if (!no_reduce_keys)
{
// A modifier was not used for a mapping, apply it to ASCII
// keys.
if ((mod_mask & MOD_MASK_CTRL)
&& ((c >= '`' && c <= 0x7f)
|| (c >= '@' && c <= '_')))
{
c &= 0x1f;
mod_mask &= ~MOD_MASK_CTRL;
}
if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
&& c >= 0 && c <= 127)
{
c += 0x80;
mod_mask &= ~(MOD_MASK_META|MOD_MASK_ALT);
}
}
break;
}
}

View File

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