diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2017-08-19 23:28:36 -0400 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-20 12:28:36 +0900 |
| commit | 3399e39968473b1920db19ef1969b9df34bdd3c1 (patch) | |
| tree | 7f47d700d0e047e548641d4f229587b4cefc3e1b /plugin/fzf.vim | |
| parent | 87874bba88c315b11ce5da37c178e6fdedb8708a (diff) | |
| download | fzf-3399e39968473b1920db19ef1969b9df34bdd3c1.tar.gz | |
[vim] Escape backslashes in fzf#shellescape (#1021)
Diffstat (limited to 'plugin/fzf.vim')
| -rw-r--r-- | plugin/fzf.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 9ce03c03..b08d0f65 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -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, ...) |
