summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-14 21:32:02 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-14 21:32:02 +0100
commitcd1a62d468a55aca68deb3139d83530c7c23568d (patch)
tree37644066fac5d64c48b955b2f4436f051e661fe9 /src/channel.c
parent142a9758151e470307a80ea37b06ea34558ff5b3 (diff)
patch 8.1.0590: when a job ends the closed channels are not handledv8.1.0590
Problem: When a job ends the closed channels are not handled. Solution: When a job is detected to have ended, check the channels again. (closes #3530)
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/channel.c b/src/channel.c
index 0ca6e54954..11ecc16859 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -5510,24 +5510,28 @@ has_pending_job(void)
/*
* Called once in a while: check if any jobs that seem useful have ended.
+ * Returns TRUE if a job did end.
*/
- void
+ int
job_check_ended(void)
{
int i;
+ int did_end = FALSE;
+ // be quick if there are no jobs to check
if (first_job == NULL)
- return;
+ return did_end;
for (i = 0; i < MAX_CHECK_ENDED; ++i)
{
- /* NOTE: mch_detect_ended_job() must only return a job of which the
- * status was just set to JOB_ENDED. */
+ // NOTE: mch_detect_ended_job() must only return a job of which the
+ // status was just set to JOB_ENDED.
job_T *job = mch_detect_ended_job(first_job);
if (job == NULL)
break;
- job_cleanup(job); /* may free "job" */
+ did_end = TRUE;
+ job_cleanup(job); // may free "job"
}
if (channel_need_redraw)
@@ -5535,6 +5539,7 @@ job_check_ended(void)
channel_need_redraw = FALSE;
redraw_after_callback(TRUE);
}
+ return did_end;
}
/*