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
index fec3a8e..e198a28 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9157,6 +9157,11 @@
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