1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:20:05 +08:00

docs(job): update :h spacevim-api-job

This commit is contained in:
wsdjeg 2023-09-16 21:48:55 +08:00
parent 743da32964
commit 92395fbeae
2 changed files with 75 additions and 0 deletions

View File

@ -24,6 +24,43 @@
" on_exit: exit event handler (function name or Funcref)
"
" cwd: working directory of the job; defaults to current directory
"
" stop(id)
"
" stop job via job id.
"
" send(id, data)
"
" send {data} to specific job.
"
" status(id)
"
" return the job status of a specific job.
"
"
" This api also can be use in lua:
"
" Example: >
" local job = require('spacevim.api.job')
"
" local function on_stdout(id, data)
"
" end
"
" local function on_stderr(id, data)
"
" end
"
" local function on_exit(id, code, single)
"
" end
"
" job.start({'vim', '--version'},
" on_stdout = on_stdout,
" on_stderr = on_stderr,
" on_exit = on_exit
" )
" <

View File

@ -6639,6 +6639,44 @@ start({cmd}[, {opt}])
cwd: working directory of the job; defaults to current directory
stop(id)
stop job via job id.
send(id, data)
send {data} to specific job.
status(id)
return the job status of a specific job.
This api also can be use in lua:
Example:
>
local job = require('spacevim.api.job')
local function on_stdout(id, data)
end
local function on_stderr(id, data)
end
local function on_exit(id, code, single)
end
job.start({'vim', '--version'},
on_stdout = on_stdout,
on_stderr = on_stderr,
on_exit = on_exit
)
<
==============================================================================
LOGGER *SpaceVim-api-logger*