plug update
This commit is contained in:
@@ -722,15 +722,25 @@ function! s:assign_name()
|
|||||||
silent! execute 'f' fnameescape(name)
|
silent! execute 'f' fnameescape(name)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:chsh(swap)
|
||||||
|
let prev = [&shell, &shellredir]
|
||||||
|
if !s:is_win && a:swap
|
||||||
|
set shell=sh shellredir=>%s\ 2>&1
|
||||||
|
endif
|
||||||
|
return prev
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:bang(cmd, ...)
|
function! s:bang(cmd, ...)
|
||||||
try
|
try
|
||||||
|
let [sh, shrd] = s:chsh(a:0)
|
||||||
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
||||||
" but it won't work on Windows.
|
" but it won't work on Windows.
|
||||||
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
||||||
let g:_plug_bang = '!'.escape(cmd, '#!%')
|
let g:_plug_bang = '!'.escape(cmd, '#!%')
|
||||||
execute "normal! :execute g:_plug_bang\<cr>\<cr>"
|
execute "normal! :execute g:_plug_bang\<cr>\<cr>"
|
||||||
finally
|
finally
|
||||||
unlet g:_plug_bang
|
unlet g:_plug_bang
|
||||||
|
let [&shell, &shellredir] = [sh, shrd]
|
||||||
endtry
|
endtry
|
||||||
return v:shell_error ? 'Exit status: ' . v:shell_error : ''
|
return v:shell_error ? 'Exit status: ' . v:shell_error : ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -1823,10 +1833,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:system(cmd, ...)
|
function! s:system(cmd, ...)
|
||||||
try
|
try
|
||||||
let [sh, shrd] = [&shell, &shellredir]
|
let [sh, shrd] = s:chsh(1)
|
||||||
if !s:is_win
|
|
||||||
set shell=sh shellredir=>%s\ 2>&1
|
|
||||||
endif
|
|
||||||
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
||||||
return system(s:is_win ? '('.cmd.')' : cmd)
|
return system(s:is_win ? '('.cmd.')' : cmd)
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user