Skip to main content
Module

x/denops_std/function/nvim/mod.ts>jobwait

📚 Standard module for denops.vim
Go to Latest
function jobwait
import { jobwait } from "https://deno.land/x/denops_std@v6.4.0/function/nvim/mod.ts";

Waits for jobs and their on_exit handlers to complete.

{jobs} is a List of job-ids 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

Parameters

denops: Denops
jobs: unknown
optional
timeout: unknown

Returns

Promise<number>