Revert "Steal Windows shell escaping from dispatch.vim"

This reverts commit 15450eff27.
This commit is contained in:
Tim Pope 2014-04-03 18:57:18 -04:00
parent da3f5857b5
commit 095ee57d12

View File

@ -34,14 +34,7 @@ function! s:shellesc(arg) abort
if a:arg =~ '^[A-Za-z0-9_/.-]\+$' if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
return a:arg return a:arg
elseif &shell =~# 'cmd' elseif &shell =~# 'cmd'
if &shellxquote ==# '"' return '"'.substitute(substitute(a:arg, '"', '""""', 'g'), '%', '"%"', 'g').'"'
return '"' . substitute(a:arg, '"', '""', 'g') . '"'
else
let esc = exists('+shellxescape') ? &shellxescape : '"&|<>()@^'
return &shellxquote .
\ substitute(a:arg, '['.esc.']', '^&', 'g') .
\ get({'(': ')', '"(': ')"'}, &shellxquote, &shellxquote)
endif
else else
let escaped = shellescape(a:arg) let escaped = shellescape(a:arg)
if &shell =~# 'sh' && &shell !~# 'csh' if &shell =~# 'sh' && &shell !~# 'csh'