summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-07 16:18:13 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-07 16:18:13 +0200
commit1ebff3dc93b6d022ccfe0613c1d1ee2d62fc7935 (patch)
treea58837c7b3b4e3f75f5ed28dc4cfadd125e6a3ae /src/ex_docmd.c
parente330ef42f256e60017e5f8bf4be79a5308fe9e2f (diff)
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed beforev8.1.0158
Problem: GUI: input() fails if CTRL-C was pressed before. (Michael Naumann) Solution: call vpeekc() to drop the CTRL-C from the input stream.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fec3a8e37a..e198a286af 100644
--- 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