]> granicus.if.org Git - vim/commitdiff
patch 8.1.0367: getchar(1) no longer processes pending messages v8.1.0367
authorBram Moolenaar <Bram@vim.org>
Tue, 11 Sep 2018 18:10:20 +0000 (20:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 11 Sep 2018 18:10:20 +0000 (20:10 +0200)
Problem:    getchar(1) no longer processes pending messages. (Yasuhiro
            Matsumoto)
Solution:   Call parse_queued_messages().

src/evalfunc.c
src/version.c

index 54e7dcdd39255d8f755a381651b3fe1ff62f2f82..19e2657bac423fd6bb42a9e564c2071235b16a96 100644 (file)
@@ -4680,6 +4680,13 @@ f_getchar(typval_T *argvars, typval_T *rettv)
     varnumber_T                n;
     int                        error = FALSE;
 
+#ifdef MESSAGE_QUEUE
+    // vpeekc() used to check for messages, but that caused problems, invoking
+    // a callback where it was not expected.  Some plugins use getchar(1) in a
+    // loop to await a message, therefore make sure we check for messages here.
+    parse_queued_messages();
+#endif
+
     /* Position the cursor.  Needed after a message that ends in a space. */
     windgoto(msg_row, msg_col);
 
index 32f0d1d9e4be0e6c48c55734036a92ade9e5bcfb..3e86c4006bfb171ed53b16c56e455bc6b7bf9c88 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    367,
 /**/
     366,
 /**/