diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-08 13:02:26 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-08 13:02:26 +0200 |
commit | 78df9eb51d7e0b61de94b8dd32d0c3782e18ba39 (patch) | |
tree | d17c7f994cacc5be0d7b6dcb31713c57f3a68274 /src | |
parent | bb24fec33355b27daa8971d9ab3a074909137781 (diff) | |
download | rneovim-78df9eb51d7e0b61de94b8dd32d0c3782e18ba39.tar.gz rneovim-78df9eb51d7e0b61de94b8dd32d0c3782e18ba39.tar.bz2 rneovim-78df9eb51d7e0b61de94b8dd32d0c3782e18ba39.zip |
vim-patch:1ebff3dc9 #10144
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before
Problem: GUI: input() fails if CTRL-C was pressed before. (Michael Naumann)
Solution: call vpeekc() to drop the CTRL-C from the input stream.
https://github.com/vim/vim/commit/1ebff3dc93b6d022ccfe0613c1d1ee2d62fc7935
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_docmd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f4082fc833..fb15bd4e66 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7415,6 +7415,12 @@ void do_sleep(long msec) LOOP_PROCESS_EVENTS_UNTIL(&main_loop, main_loop.events, (int)next, got_int); os_breakcheck(); } + + // If CTRL-C was typed to interrupt the sleep, drop the CTRL-C from the + // input buffer, otherwise a following call to input() fails. + if (got_int) { + (void)vpeekc(); + } } static void do_exmap(exarg_T *eap, int isabbrev) |