aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-03-25 14:43:19 +0000
committerJustin M. Keyes <justinkz@gmail.com>2017-03-25 15:43:19 +0100
commit098e91400eb06d29c31264ba973ea8a563703059 (patch)
tree66bb3ab14c34d5e1078ff4554636de16c3c6e4d4 /src/nvim/edit.c
parent0cd829161a3f6aa7ed9737cc1c8462067812c9c5 (diff)
downloadrneovim-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/edit.c')
-rw-r--r--src/nvim/edit.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index aa029c38a2..5544f0b163 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -689,11 +689,9 @@ static int insert_execute(VimState *state, int key)
if (s->c == Ctrl_BSL) {
// may need to redraw when no more chars available now
ins_redraw(false);
- ++no_mapping;
- ++allow_keys;
+ no_mapping++;
s->c = plain_vgetc();
- --no_mapping;
- --allow_keys;
+ no_mapping--;
if (s->c != Ctrl_N && s->c != Ctrl_G && s->c != Ctrl_O) {
// it's something else
vungetc(s->c);
@@ -8303,17 +8301,16 @@ static int ins_digraph(void)
}
- /* don't map the digraph chars. This also prevents the
- * mode message to be deleted when ESC is hit */
- ++no_mapping;
- ++allow_keys;
+ // don't map the digraph chars. This also prevents the
+ // mode message to be deleted when ESC is hit
+ no_mapping++;
c = plain_vgetc();
- --no_mapping;
- --allow_keys;
- if (did_putchar)
- /* when the line fits in 'columns' the '?' is at the start of the next
- * line and will not be removed by the redraw */
+ no_mapping--;
+ if (did_putchar) {
+ // when the line fits in 'columns' the '?' is at the start of the next
+ // line and will not be removed by the redraw
edit_unputchar();
+ }
if (IS_SPECIAL(c) || mod_mask) { /* special key */
clear_showcmd();
@@ -8333,15 +8330,14 @@ static int ins_digraph(void)
}
add_to_showcmd_c(c);
}
- ++no_mapping;
- ++allow_keys;
+ no_mapping++;
cc = plain_vgetc();
- --no_mapping;
- --allow_keys;
- if (did_putchar)
- /* when the line fits in 'columns' the '?' is at the start of the
- * next line and will not be removed by a redraw */
+ no_mapping--;
+ if (did_putchar) {
+ // when the line fits in 'columns' the '?' is at the start of the
+ // next line and will not be removed by a redraw
edit_unputchar();
+ }
if (cc != ESC) {
AppendToRedobuff((char_u *)CTRL_V_STR);
c = getdigraph(c, cc, TRUE);