From d487dc1a9a63bb1d6d12658ed7ed24382b55a4b1 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 2 Apr 2015 11:22:24 -0300 Subject: [PATCH] eval: Ensure all job callbacks are invoked by `jobwait()` A call to `event_poll` is required to ensure the exit callback from the last job is invoked. --- src/nvim/eval.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dae688eb5a..4ab31985b5 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10972,6 +10972,9 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv) } } + // poll to ensure any pending callbacks from the last job are invoked + event_poll(0); + for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next) { Job *job = NULL; if (arg->li_tv.v_type != VAR_NUMBER