aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-28 18:11:05 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-28 20:53:56 +0800
commitbea439fe99bb49d116f9f5d288ea13d76fb520f1 (patch)
tree0ade20f39f1f722355ea39f0ccf203a33c2aaca1 /src/nvim/normal.c
parent175692325bfeea280b105951949e71a5a4b430d1 (diff)
downloadrneovim-bea439fe99bb49d116f9f5d288ea13d76fb520f1.tar.gz
rneovim-bea439fe99bb49d116f9f5d288ea13d76fb520f1.tar.bz2
rneovim-bea439fe99bb49d116f9f5d288ea13d76fb520f1.zip
vim-patch:8.2.4237: record buffer wrong if character in Select mode was not typed
Problem: Record buffer wrong if character in Select mode was not typed. Solution: Only delete the tail from the record buffer if the character was typed. (closes vim/vim#9650) https://github.com/vim/vim/commit/fbf4f1ca159028382eaeb3bfc31bb6bb96dbb67a
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';