vim-patch:8.2.4002: first char typed in Select mode can be wrong

Problem:    First char typed in Select mode can be wrong.
Solution:   Escape special bytes in the input buffer. (closes vim/vim#9469)
6cac77016b

The `buf` should already be large enough, but I'll change its size
anyway in case future patches change the meaning of `MB_MAXBYTES` macro.

`fix_input_buffer()` cannot be used here because of the `using_script()`
check, and there is already equivalent code in its place.
This commit is contained in:
zeertzjq
2022-01-24 12:46:52 +08:00
parent 8f1efb018b
commit 5c897b6d0c
2 changed files with 53 additions and 1 deletions

View File

@@ -984,7 +984,7 @@ int ins_typebuf(char_u *str, int noremap, int offset, bool nottyped, bool silent
/// @return the length of what was inserted
int ins_char_typebuf(int c, int modifier)
{
char_u buf[MB_MAXBYTES + 4];
char_u buf[MB_MAXBYTES * 3 + 4];
int len = 0;
if (modifier != 0) {
buf[0] = K_SPECIAL;