diff options
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 0ac4039d11..76ee9f1f40 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1011,7 +1011,12 @@ static int normal_execute(VimState *state, int key) // restart automatically. // Insert the typed character in the typeahead buffer, so that it can // be mapped in Insert mode. Required for ":lmap" to work. - ins_char_typebuf(s->c, mod_mask); + int len = ins_char_typebuf(s->c, mod_mask); + + // When recording the character will be recorded again, remove the + // previously recording. + ungetchars(len); + if (restart_edit != 0) { s->c = 'd'; } else { @@ -6324,11 +6329,9 @@ static void nv_g_cmd(cmdarg_T *cap) break; case 'M': { - const char_u *const ptr = get_cursor_line_ptr(); - oap->motion_type = kMTCharWise; oap->inclusive = false; - i = (int)mb_string2cells_len(ptr, STRLEN(ptr)); + i = linetabsize(get_cursor_line_ptr()); if (cap->count0 > 0 && cap->count0 <= 100) { coladvance((colnr_T)(i * cap->count0 / 100)); } else { |