mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
parent
5fc9eab788
commit
d6bda025f1
12
plug.vim
12
plug.vim
@ -1143,6 +1143,9 @@ endfunction
|
|||||||
function! s:job_exit_cb(self, data) abort
|
function! s:job_exit_cb(self, data) abort
|
||||||
let a:self.running = 0
|
let a:self.running = 0
|
||||||
let a:self.error = a:data != 0
|
let a:self.error = a:data != 0
|
||||||
|
if has_key(a:self, 'tempname')
|
||||||
|
call delete(a:self.tempname)
|
||||||
|
endif
|
||||||
call s:reap(a:self.name)
|
call s:reap(a:self.name)
|
||||||
call s:tick()
|
call s:tick()
|
||||||
endfunction
|
endfunction
|
||||||
@ -1164,8 +1167,8 @@ function! s:spawn(name, cmd, opts)
|
|||||||
let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''],
|
let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''],
|
||||||
\ 'new': get(a:opts, 'new', 0) }
|
\ 'new': get(a:opts, 'new', 0) }
|
||||||
let s:jobs[a:name] = job
|
let s:jobs[a:name] = job
|
||||||
let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'],
|
let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd
|
||||||
\ has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd)
|
let argv = s:is_win ? cmd : ['sh', '-c', cmd]
|
||||||
|
|
||||||
if s:nvim
|
if s:nvim
|
||||||
call extend(job, {
|
call extend(job, {
|
||||||
@ -1182,6 +1185,11 @@ function! s:spawn(name, cmd, opts)
|
|||||||
\ 'Invalid arguments (or job table is full)']
|
\ 'Invalid arguments (or job table is full)']
|
||||||
endif
|
endif
|
||||||
elseif s:vim8
|
elseif s:vim8
|
||||||
|
if s:is_win
|
||||||
|
let job.tempname = tempname().'.bat'
|
||||||
|
call writefile([argv], job.tempname)
|
||||||
|
let argv = job.tempname
|
||||||
|
endif
|
||||||
let jid = job_start(argv, {
|
let jid = job_start(argv, {
|
||||||
\ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]),
|
\ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]),
|
||||||
\ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]),
|
\ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]),
|
||||||
|
Loading…
Reference in New Issue
Block a user