Treat unmapped ALT/META as ESC+c in all modes

In #8226 <A-x> and <M-x> were changed to behave like <Esc>x in insert
mode when no mapping exists. This commit backs out that change and
replaces it with a more general one that makes unmapped ALT and META
keypresses as <Esc>+char in all modes. This fixes an unnecessary and
confusing inconsistency between modes.
This commit is contained in:
Matt Wozniski
2020-10-04 02:37:45 -04:00
parent f6ac375604
commit 2f06413dfb
9 changed files with 68 additions and 12 deletions

View File

@@ -1254,14 +1254,6 @@ check_pum:
normalchar:
// Insert a normal character.
if (mod_mask == MOD_MASK_ALT || mod_mask == MOD_MASK_META) {
// Unmapped ALT/META chord behaves like ESC+c. #8213
stuffcharReadbuff(ESC);
stuffcharReadbuff(s->c);
u_sync(false);
break;
}
if (!p_paste) {
// Trigger InsertCharPre.
char_u *str = do_insert_char_pre(s->c);