comparison src/term.c @ 20927:9328feafbbf5 v8.2.1015

patch 8.2.1015: popup filter gets key with modifier prepended Commit: https://github.com/vim/vim/commit/20298ce679dbf21c07c8fe2161724a12424f1e69 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 19 21:46:52 2020 +0200 patch 8.2.1015: popup filter gets key with modifier prepended Problem: Popup filter gets key with modifier prepended when using modifyOtherKeys. Solution: Remove the shift modifier when it is included in the key, also when the Alt or Meta modifier is used.
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Jun 2020 22:00:04 +0200
parents bd56f4045f37
children d64520bfafa0
comparison
equal deleted inserted replaced
20926:6ef0f635ce16 20927:9328feafbbf5
4770 modifiers = decode_modifiers(arg[1]); 4770 modifiers = decode_modifiers(arg[1]);
4771 4771
4772 // Some keys already have Shift included, pass them as 4772 // Some keys already have Shift included, pass them as
4773 // normal keys. Not when Ctrl is also used, because <C-H> 4773 // normal keys. Not when Ctrl is also used, because <C-H>
4774 // and <C-S-H> are different. 4774 // and <C-S-H> are different.
4775 if (modifiers == MOD_MASK_SHIFT 4775 // Also for <A-S-a> and <M-S-a>.
4776 if ((modifiers == MOD_MASK_SHIFT
4777 || modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT)
4778 || modifiers == (MOD_MASK_SHIFT | MOD_MASK_META))
4776 && ((key >= '@' && key <= 'Z') 4779 && ((key >= '@' && key <= 'Z')
4777 || key == '^' || key == '_' 4780 || key == '^' || key == '_'
4778 || (key >= '{' && key <= '~'))) 4781 || (key >= '{' && key <= '~')))
4779 modifiers = 0; 4782 modifiers &= ~MOD_MASK_SHIFT;
4780 4783
4781 // When used with Ctrl we always make a letter upper case, 4784 // When used with Ctrl we always make a letter upper case,
4782 // so that mapping <C-H> and <C-h> are the same. Typing 4785 // so that mapping <C-H> and <C-h> are the same. Typing
4783 // <C-S-H> also uses "H" but modifier is different. 4786 // <C-S-H> also uses "H" but modifier is different.
4784 if ((modifiers & MOD_MASK_CTRL) && ASCII_ISALPHA(key)) 4787 if ((modifiers & MOD_MASK_CTRL) && ASCII_ISALPHA(key))