aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-27 09:03:09 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-29 15:51:04 +0800
commitf6afc7c3246db6e5bd8feab717b3c0dbf0226803 (patch)
tree533dc9a6727f66e9a64fd4a129ea87c0c7e0cc5b /src/nvim/getchar.c
parentd531ef6813919dd6df8ca6927cd99ec3c0a65635 (diff)
downloadrneovim-f6afc7c3246db6e5bd8feab717b3c0dbf0226803.tar.gz
rneovim-f6afc7c3246db6e5bd8feab717b3c0dbf0226803.tar.bz2
rneovim-f6afc7c3246db6e5bd8feab717b3c0dbf0226803.zip
revert: "refactor: Remove allow_keys global (#6346)"
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 9a89170a10..63e26fd0a4 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -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;