diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-12-10 18:09:55 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-12-10 18:09:55 +0800 |
commit | 40ed2b51cb02cf1d50c67aaf4638da9ca134d59f (patch) | |
tree | 51b8bbdb04dbbf043b6ce4fd095ea97587a1697d /src | |
parent | 26eb6051528186270b924c7c806a3f434c233530 (diff) | |
download | rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.tar.gz rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.tar.bz2 rneovim-40ed2b51cb02cf1d50c67aaf4638da9ca134d59f.zip |
fix(tui): end streamed paste correctly when key buffer is empty
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/tui/input.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 5bb6059fa7..5fec41f9a5 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -114,6 +114,12 @@ static void tinput_done_event(void **argv) static void tinput_wait_enqueue(void **argv) { TermInput *input = argv[0]; + if (rbuffer_size(input->key_buffer) == 0 && input->paste == 3) { + const String keys = { .data = "", .size = 0 }; + String copy = copy_string(keys); + multiqueue_put(main_loop.events, tinput_paste_event, 3, + copy.data, copy.size, (intptr_t)input->paste); + } RBUFFER_UNTIL_EMPTY(input->key_buffer, buf, len) { const String keys = { .data = buf, .size = len }; if (input->paste) { |