aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-24 12:46:52 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-24 12:46:52 +0800
commit5c897b6d0ceb7e7d40c0b740ab36d38bf3a4162d (patch)
treef7170306d96a0c282d74c85fcda43dc557e5474d /src/nvim/getchar.c
parent8f1efb018bff6ae95fae62e5ae943d6478e9c547 (diff)
downloadrneovim-5c897b6d0ceb7e7d40c0b740ab36d38bf3a4162d.tar.gz
rneovim-5c897b6d0ceb7e7d40c0b740ab36d38bf3a4162d.tar.bz2
rneovim-5c897b6d0ceb7e7d40c0b740ab36d38bf3a4162d.zip
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) https://github.com/vim/vim/commit/6cac77016b1636e04073e8348b7cee02259ef928 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.
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 72f7f9cd5c..95720c498a 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -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;