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