refactor: Remove allow_keys global (#6346)

* The allow_keys global is unused in nvim, remove it

* clint
This commit is contained in:
Matthew Malcomson
2017-03-25 14:43:19 +00:00
committed by Justin M. Keyes
parent 0cd829161a
commit 098e91400e
11 changed files with 74 additions and 117 deletions

View File

@@ -642,8 +642,7 @@ static void normal_get_additional_char(NormalState *s)
bool langmap_active = false; // using :lmap mappings
int lang; // getting a text character
++no_mapping;
++allow_keys; // no mapping for nchar, but allow key codes
no_mapping++;
// Don't generate a CursorHold event here, most commands can't handle
// it, e.g., nv_replace(), nv_csearch().
did_cursorhold = true;
@@ -681,8 +680,7 @@ static void normal_get_additional_char(NormalState *s)
}
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) {
// Allow mappings defined with ":lmap".
--no_mapping;
--allow_keys;
no_mapping--;
if (repl) {
State = LREPLACE;
} else {
@@ -695,8 +693,7 @@ static void normal_get_additional_char(NormalState *s)
if (langmap_active) {
// Undo the decrement done above
++no_mapping;
++allow_keys;
no_mapping++;
State = NORMAL_BUSY;
}
State = NORMAL_BUSY;
@@ -781,8 +778,7 @@ static void normal_get_additional_char(NormalState *s)
}
no_mapping++;
}
--no_mapping;
--allow_keys;
no_mapping--;
}
static void normal_invert_horizontal(NormalState *s)
@@ -832,8 +828,7 @@ static bool normal_get_command_count(NormalState *s)
}
if (s->ctrl_w) {
++no_mapping;
++allow_keys; // no mapping for nchar, but keys
no_mapping++;
}
++no_zero_mapping; // don't map zero here
@@ -841,8 +836,7 @@ static bool normal_get_command_count(NormalState *s)
LANGMAP_ADJUST(s->c, true);
--no_zero_mapping;
if (s->ctrl_w) {
--no_mapping;
--allow_keys;
no_mapping--;
}
s->need_flushbuf |= add_to_showcmd(s->c);
}
@@ -852,12 +846,10 @@ static bool normal_get_command_count(NormalState *s)
s->ctrl_w = true;
s->ca.opcount = s->ca.count0; // remember first count
s->ca.count0 = 0;
++no_mapping;
++allow_keys; // no mapping for nchar, but keys
no_mapping++;
s->c = plain_vgetc(); // get next character
LANGMAP_ADJUST(s->c, true);
--no_mapping;
--allow_keys;
no_mapping--;
s->need_flushbuf |= add_to_showcmd(s->c);
return true;
}
@@ -4043,12 +4035,10 @@ static void nv_zet(cmdarg_T *cap)
return;
n = nchar - '0';
for (;; ) {
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
no_mapping++;
nchar = plain_vgetc();
LANGMAP_ADJUST(nchar, true);
--no_mapping;
--allow_keys;
no_mapping--;
(void)add_to_showcmd(nchar);
if (nchar == K_DEL || nchar == K_KDEL)
n /= 10;
@@ -4376,13 +4366,11 @@ dozet:
break;
case 'u': /* "zug" and "zuw": undo "zg" and "zw" */
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
case 'u': // "zug" and "zuw": undo "zg" and "zw"
no_mapping++;
nchar = plain_vgetc();
LANGMAP_ADJUST(nchar, true);
--no_mapping;
--allow_keys;
no_mapping--;
(void)add_to_showcmd(nchar);
if (vim_strchr((char_u *)"gGwW", nchar) == NULL) {
clearopbeep(cap->oap);