vim-patch:8.2.0839: dropping modifier when putting a character back in typeahead

Problem:    Dropping modifier when putting a character back in typeahead.
Solution:   Add modifier to ins_char_typebuf(). (closes vim/vim#6158)
b42c0d5427

Vim's test doesn't seem to work properly as the hit-enter prompt seems
to be delayed. Add a Lua screen test.
This commit is contained in:
zeertzjq
2022-04-25 21:40:46 +08:00
parent 82a13a78bb
commit 66747f18de
7 changed files with 53 additions and 3 deletions

View File

@@ -1499,6 +1499,8 @@ int vgetc(void)
static size_t last_vgetc_recorded_len = 0;
mod_mask = 0;
vgetc_mod_mask = 0;
vgetc_char = 0;
// last_recorded_len can be larger than last_vgetc_recorded_len
// if peeking records more
@@ -1624,6 +1626,10 @@ int vgetc(void)
// A modifier was not used for a mapping, apply it to ASCII
// keys. Shift would already have been applied.
// Remember the character and mod_mask from before, in some
// cases they are put back in the typeahead buffer.
vgetc_mod_mask = mod_mask;
vgetc_char = c;
c = merge_modifiers(c);
// If mappings are enabled (i.e., not Ctrl-v) and the user directly typed