import { jobwait } from "https://deno.land/x/denops_std@v5.0.2/function/nvim/mod.ts";
Waits for jobs and their on_exit
handlers to complete.
{jobs} is a List of job-id
s to wait for.
{timeout} is the maximum waiting time in milliseconds. If
omitted or -1, wait forever.
Timeout of 0 can be used to check the status of a job:
let running = jobwait([{job-id}], 0)[0] == -1
During jobwait() callbacks for jobs not in the {jobs} list may
be invoked. The screen will not redraw unless :redraw
is
invoked by a callback.
Returns a list of len({jobs}) integers, where each integer is
the status of the corresponding job:
Exit-code, if the job exited
-1 if the timeout was exceeded
-2 if the job was interrupted (by CTRL-C
)
-3 if the job-id is invalid