From 93820638607a5082c99d4c012617d779f8bc2589 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Aug 2019 17:12:52 -0400 Subject: [PATCH] batchfile is not required in s:spawn User's shell settings do not affect Vim/Neovim jobs. --- plug.vim | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plug.vim b/plug.vim index a406047..40cffe6 100644 --- a/plug.vim +++ b/plug.vim @@ -1202,15 +1202,10 @@ endfunction function! s:spawn(name, cmd, opts) let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'batchfile': (s:is_win && (s:nvim || s:vim8)) ? tempname().'.bat' : '', \ 'new': get(a:opts, 'new', 0) } let s:jobs[a:name] = job let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd - if !empty(job.batchfile) - call writefile(["@echo off\r", cmd . "\r"], job.batchfile) - let cmd = s:shellesc(job.batchfile) - endif - let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd) + let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] if s:nvim call extend(job, { @@ -1260,9 +1255,6 @@ function! s:reap(name) call s:log(bullet, a:name, empty(result) ? 'OK' : result) call s:bar() - if has_key(job, 'batchfile') && !empty(job.batchfile) - call delete(job.batchfile) - endif call remove(s:jobs, a:name) endfunction