Mercurial > vim
changeset 14284:7cd8298c4c04 v8.1.0158
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before
commit https://github.com/vim/vim/commit/1ebff3dc93b6d022ccfe0613c1d1ee2d62fc7935
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 7 16:18:13 2018 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 07 Jul 2018 16:30:06 +0200 |
parents | 654dec329c7f |
children | 446c03a95578 |
files | src/ex_docmd.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -9157,6 +9157,11 @@ do_sleep(long msec) parse_queued_messages(); #endif } + + // 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