changeset 14710:b9a4e49a3f7c v8.1.0367

patch 8.1.0367: getchar(1) no longer processes pending messages commit https://github.com/vim/vim/commit/84d9390480548c8d711dd772cb162a91d0bb3c30 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 11 20:10:20 2018 +0200 patch 8.1.0367: getchar(1) no longer processes pending messages Problem: getchar(1) no longer processes pending messages. (Yasuhiro Matsumoto) Solution: Call parse_queued_messages().
author Christian Brabandt <cb@256bit.org>
date Tue, 11 Sep 2018 20:15:07 +0200
parents a5265f6bf10c
children 70c3e1dfcbee
files src/evalfunc.c src/version.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4680,6 +4680,13 @@ f_getchar(typval_T *argvars, typval_T *r
     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);
 
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    367,
+/**/
     366,
 /**/
     365,