# HG changeset patch # User Christian Brabandt # Date 1530973806 -7200 # Node ID 7cd8298c4c0497783c9e48db4a4d9b10ebfa0215 # Parent 654dec329c7fdc38bfd485b07d9504ac0dc9b4f8 patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before commit https://github.com/vim/vim/commit/1ebff3dc93b6d022ccfe0613c1d1ee2d62fc7935 Author: Bram Moolenaar 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. diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -790,6 +790,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 158, +/**/ 157, /**/ 156,