diff options
author | Matthew Malcomson <hardenedapple@gmail.com> | 2017-03-25 14:43:19 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-25 15:43:19 +0100 |
commit | 098e91400eb06d29c31264ba973ea8a563703059 (patch) | |
tree | 66bb3ab14c34d5e1078ff4554636de16c3c6e4d4 /src/nvim/getchar.c | |
parent | 0cd829161a3f6aa7ed9737cc1c8462067812c9c5 (diff) | |
download | rneovim-098e91400eb06d29c31264ba973ea8a563703059.tar.gz rneovim-098e91400eb06d29c31264ba973ea8a563703059.tar.bz2 rneovim-098e91400eb06d29c31264ba973ea8a563703059.zip |
refactor: Remove allow_keys global (#6346)
* The allow_keys global is unused in nvim, remove it
* clint
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index bae8ae6d91..0c131d7b33 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1389,27 +1389,20 @@ int vgetc(void) for (;; ) { // this is done twice if there are modifiers bool did_inc = false; if (mod_mask) { // no mapping after modifier has been read - ++no_mapping; - ++allow_keys; + no_mapping++; did_inc = true; // mod_mask may change value } c = vgetorpeek(true); if (did_inc) { - --no_mapping; - --allow_keys; + no_mapping--; } - /* 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; + // Get two extra bytes for special keys + if (c == K_SPECIAL) { + no_mapping++; + c2 = vgetorpeek(true); // no mapping for these chars + c = vgetorpeek(true); + no_mapping--; if (c2 == KS_MODIFIER) { mod_mask = c; continue; @@ -1487,7 +1480,7 @@ int vgetc(void) buf[i] = CSI; } } - --no_mapping; + no_mapping--; c = (*mb_ptr2char)(buf); } @@ -1570,7 +1563,7 @@ int char_avail(void) no_mapping++; retval = vpeekc(); - --no_mapping; + no_mapping--; return retval != NUL; } |