]> granicus.if.org Git - vim/commitdiff
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before v8.1.0158
authorBram Moolenaar <Bram@vim.org>
Sat, 7 Jul 2018 14:18:13 +0000 (16:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 7 Jul 2018 14:18:13 +0000 (16:18 +0200)
Problem:    GUI: input() fails if CTRL-C was pressed before. (Michael Naumann)
Solution:   call vpeekc() to drop the CTRL-C from the input stream.

src/ex_docmd.c
src/version.c

index fec3a8e37a43b244528c00c6b7827d8fc93a267e..e198a286af98e8e54d440fc3e97a84e0efb51f1a 100644 (file)
@@ -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
index 8d9a339f9694a6881c52cc2bc962fbd344c8777b..c8dde84e1e4cb417402babdb982f9a014cb5dd12 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    158,
 /**/
     157,
 /**/