summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-11 20:10:20 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-11 20:10:20 +0200
commit84d9390480548c8d711dd772cb162a91d0bb3c30 (patch)
treebad40506b246a5dec5a47f6ae3220190805f1b8e /src/evalfunc.c
parent007921611b04d8fca5ad0b1d4e7b0461b47cd435 (diff)
patch 8.1.0367: getchar(1) no longer processes pending messagesv8.1.0367
Problem: getchar(1) no longer processes pending messages. (Yasuhiro Matsumoto) Solution: Call parse_queued_messages().
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 54e7dcdd39..19e2657bac 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -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);