diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2019-06-23 18:28:04 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-24 00:28:04 +0200 |
commit | 9fd4a0b52697db053143f51822e68da95c6886aa (patch) | |
tree | 1fe05b2d328eb96ce9dedfc143fe60e7713d85fc /src | |
parent | 0bdeec8ef02bcd497f6df77b2a00420c948c9438 (diff) | |
download | rneovim-9fd4a0b52697db053143f51822e68da95c6886aa.tar.gz rneovim-9fd4a0b52697db053143f51822e68da95c6886aa.tar.bz2 rneovim-9fd4a0b52697db053143f51822e68da95c6886aa.zip |
getchar: Handle incomplete <Paste> in typeahead buffer #10311
<Paste> is a 3-byte sequence and the beginning one or two bytes can appear at
the very end of the typeahead buffer. When this happens, we were exiting from
`vgetorpeek()` instead of reading more characters to see the complete sequence.
I think this should fix #7994 -- at least partially. Before this change, when I
paste exactly 64 characters into a freshly booted instance, I get what I pasted
plus the literal text "<Paste>" at the end. Nvim also stays in nopaste mode.
The attached test case fails in this manner without the code change.
Fix #7994
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/getchar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 465c41457a..44e4e09486 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1936,7 +1936,8 @@ static int vgetorpeek(int advance) } if ((mp == NULL || max_mlen >= mp_match_len) - && keylen != KEYLEN_PART_MAP) { + && keylen != KEYLEN_PART_MAP + && !(keylen == KEYLEN_PART_KEY && c1 == ui_toggle[0])) { // No matching mapping found or found a non-matching mapping that // matches at least what the matching mapping matched keylen = 0; |