aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 76ee9f1f40..28e5d47dbc 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1013,9 +1013,11 @@ static int normal_execute(VimState *state, int key)
// be mapped in Insert mode. Required for ":lmap" to work.
int len = ins_char_typebuf(s->c, mod_mask);
- // When recording the character will be recorded again, remove the
- // previously recording.
- ungetchars(len);
+ // When recording and gotchars() was called the character will be
+ // recorded again, remove the previous recording.
+ if (KeyTyped) {
+ ungetchars(len);
+ }
if (restart_edit != 0) {
s->c = 'd';