revert: "refactor: Remove allow_keys global (#6346)"

This commit is contained in:
zeertzjq
2022-04-27 09:03:09 +08:00
parent d531ef6813
commit f6afc7c324
11 changed files with 42 additions and 0 deletions

View File

@@ -1511,19 +1511,24 @@ int vgetc(void)
bool did_inc = false;
if (mod_mask) { // no mapping after modifier has been read
no_mapping++;
allow_keys++;
did_inc = true; // mod_mask may change value
}
c = vgetorpeek(true);
if (did_inc) {
no_mapping--;
allow_keys--;
}
// Get two extra bytes for special keys
if (c == K_SPECIAL) {
int save_allow_keys = allow_keys;
no_mapping++;
allow_keys = 0; // make sure BS is not found
c2 = vgetorpeek(true); // no mapping for these chars
c = vgetorpeek(true);
no_mapping--;
allow_keys = save_allow_keys;
if (c2 == KS_MODIFIER) {
mod_mask = c;
continue;