mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 08:30:06 +08:00
docs(job): update :h spacevim-api-job
This commit is contained in:
parent
743da32964
commit
92395fbeae
@ -24,6 +24,43 @@
|
|||||||
" on_exit: exit event handler (function name or Funcref)
|
" on_exit: exit event handler (function name or Funcref)
|
||||||
"
|
"
|
||||||
" cwd: working directory of the job; defaults to current directory
|
" 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
|
||||||
|
" )
|
||||||
|
" <
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6639,6 +6639,44 @@ start({cmd}[, {opt}])
|
|||||||
|
|
||||||
cwd: working directory of the job; defaults to current directory
|
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*
|
LOGGER *SpaceVim-api-logger*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user