vim-patch:8.2.3993: when recording a change in Select mode char appears twice

Problem:    When recording a change in Select mode the first typed character
            appears twice.
Solution:   When putting the character back into typeahead remove it from
            recorded characters. (closes vim/vim#9462)
c88e977862
This commit is contained in:
zeertzjq
2022-01-24 12:46:52 +08:00
parent 7e2ce35e3b
commit 8f1efb018b
3 changed files with 58 additions and 18 deletions

View File

@@ -1010,7 +1010,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 {