[vim] Escape backslashes in fzf#shellescape (#1021)

This commit is contained in:
Jan Edmund Lazo
2017-08-19 23:28:36 -04:00
committed by Junegunn Choi
parent 87874bba88
commit 3399e39968
2 changed files with 6 additions and 4 deletions

View File

@@ -66,8 +66,8 @@ function! s:shellesc_cmd(arg)
let escaped = substitute(a:arg, '[&|<>()@^]', '^&', 'g')
let escaped = substitute(escaped, '%', '%%', 'g')
let escaped = substitute(escaped, '"', '\\^&', 'g')
let escaped = substitute(escaped, '\\\+\(\\^\)', '\\\\\1', 'g')
return '^"'.substitute(escaped, '[^\\]\zs\\$', '\\\\', '').'^"'
let escaped = substitute(escaped, '\(\\\+\)\(\\^\)', '\1\1\2', 'g')
return '^"'.substitute(escaped, '\(\\\+\)$', '\1\1', '').'^"'
endfunction
function! fzf#shellescape(arg, ...)