1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
function! linkvim#jobs#vim#run(cmd) abort
call s:vim_{s:os}_run(a:cmd)
endfunction
let s:os = has('win32') ? 'win' : 'unix'
" vint: next-line -ProhibitUnusedVariable
function! s:vim_unix_run(cmd) abort
silent! call system(a:cmd)
endfunction
" vint: next-line -ProhibitUnusedVariable
function! s:vim_win_run(cmd) abort
let s:saveshell = [
\ &shell,
\ &shellcmdflag,
\ &shellquote,
\ &shellxquote,
\ &shellredir,
\ &shellslash
\]
set shell& shellcmdflag& shellquote& shellxquote& shellredir& shellslash&
silent! call system('cmd /s /c "' . a:cmd . '"')
let [ &shell,
\ &shellcmdflag,
\ &shellquote,
\ &shellxquote,
\ &shellredir,
\ &shellslash] = s:saveshell
endfunction
|