1
0
forked from aniani/vim

patch 9.0.1302: on a Belgian keyboard CTRL-] does not work

Problem:    On a Belgian keyboard CTRL-] does not work.
Solution:   Translate CTRL-$ into CTRL-]. (closes #11831)
This commit is contained in:
Bram Moolenaar
2023-02-11 16:15:50 +00:00
parent 9d9a20ee87
commit aab2ead008
3 changed files with 12 additions and 3 deletions

View File

@@ -1543,7 +1543,7 @@ find_special_key(
int
may_adjust_key_for_ctrl(int modifiers, int key)
{
if (!(modifiers & MOD_MASK_CTRL))
if ((modifiers & MOD_MASK_CTRL) == 0)
return key;
if (ASCII_ISALPHA(key))
@@ -1559,6 +1559,13 @@ may_adjust_key_for_ctrl(int modifiers, int key)
return '^';
if (key == '-')
return '_';
// On a Belgian keyboard AltGr $ is ']', on other keyboards '$' can only be
// obtained with Shift. Assume that '$' without shift implies a Belgian
// keyboard, where CTRL-$ means CTRL-].
if (key == '$' && (modifiers & MOD_MASK_SHIFT) == 0)
return ']';
return key;
}