diff options
Diffstat (limited to 'src/nvim/normal.c')
| -rw-r--r-- | src/nvim/normal.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index a04316f5e4..c5d7e603cd 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -638,6 +638,7 @@ static void normal_get_additional_char(NormalState *s) int lang; // getting a text character no_mapping++; + allow_keys++; // no mapping for nchar, but allow key codes // Don't generate a CursorHold event here, most commands can't handle // it, e.g., nv_replace(), nv_csearch(). did_cursorhold = true; @@ -676,6 +677,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--; if (repl) { State = LREPLACE; } else { @@ -689,6 +691,7 @@ static void normal_get_additional_char(NormalState *s) if (langmap_active) { // Undo the decrement done above no_mapping++; + allow_keys++; } State = NORMAL_BUSY; s->need_flushbuf |= add_to_showcmd(*cp); @@ -769,6 +772,7 @@ static void normal_get_additional_char(NormalState *s) no_mapping++; } no_mapping--; + allow_keys--; } static void normal_invert_horizontal(NormalState *s) @@ -826,6 +830,7 @@ static bool normal_get_command_count(NormalState *s) if (s->ctrl_w) { no_mapping++; + allow_keys++; // no mapping for nchar, but keys } no_zero_mapping++; // don't map zero here @@ -834,6 +839,7 @@ static bool normal_get_command_count(NormalState *s) no_zero_mapping--; if (s->ctrl_w) { no_mapping--; + allow_keys--; } s->need_flushbuf |= add_to_showcmd(s->c); } @@ -844,9 +850,11 @@ static bool normal_get_command_count(NormalState *s) s->ca.opcount = s->ca.count0; // remember first count s->ca.count0 = 0; no_mapping++; + allow_keys++; // no mapping for nchar, but keys s->c = plain_vgetc(); // get next character LANGMAP_ADJUST(s->c, true); no_mapping--; + allow_keys--; s->need_flushbuf |= add_to_showcmd(s->c); return true; } @@ -3407,9 +3415,11 @@ static void nv_zet(cmdarg_T *cap) n = nchar - '0'; for (;;) { no_mapping++; + allow_keys++; // no mapping for nchar, but allow key codes nchar = plain_vgetc(); LANGMAP_ADJUST(nchar, true); no_mapping--; + allow_keys--; (void)add_to_showcmd(nchar); if (nchar == K_DEL || nchar == K_KDEL) { n /= 10; @@ -3785,9 +3795,11 @@ dozet: case 'u': // "zug" and "zuw": undo "zg" and "zw" no_mapping++; + allow_keys++; // no mapping for nchar, but allow key codes nchar = plain_vgetc(); LANGMAP_ADJUST(nchar, true); no_mapping--; + allow_keys--; (void)add_to_showcmd(nchar); if (vim_strchr((char_u *)"gGwW", nchar) == NULL) { clearopbeep(cap->oap); |
