Do not escape simple shell arguments
Regexp taken from vim-fugitive s:shellesc().
This commit is contained in:
parent
eb00506f36
commit
ba7ddedb9a
3
plug.vim
3
plug.vim
|
@ -2069,6 +2069,9 @@ endfunction
|
||||||
" If unset, fallback to 'cmd.exe' on Windows or 'sh'.
|
" If unset, fallback to 'cmd.exe' on Windows or 'sh'.
|
||||||
" - script: If truthy and shell is cmd.exe, escape for batchfile syntax.
|
" - script: If truthy and shell is cmd.exe, escape for batchfile syntax.
|
||||||
function! plug#shellescape(arg, ...)
|
function! plug#shellescape(arg, ...)
|
||||||
|
if a:arg =~# '^[A-Za-z0-9_/:.-]\+$'
|
||||||
|
return a:arg
|
||||||
|
endif
|
||||||
let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {}
|
let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {}
|
||||||
let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
|
let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
|
||||||
let script = get(opts, 'script', 1)
|
let script = get(opts, 'script', 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user