diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-09-05 21:39:12 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-09-05 21:39:12 +0900 |
commit | ac160f98a8f5aa9ad148a7c6e694b10586652824 (patch) | |
tree | a00ace6349c831459cd4fc2316fd4c6fb3026635 | |
parent | 62e01a2a62ac2d4a8ee4c87723f689516e710828 (diff) |
[gvim] Fix #342 - Should not escape launcher part of the command
-rw-r--r-- | plugin/fzf.vim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 65b4aff7..eea1ffd3 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -217,14 +217,15 @@ let s:launcher = function('s:xterm_launcher') function! s:execute(dict, command, temps) call s:pushd(a:dict) silent! !clear 2> /dev/null + let escaped = escape(substitute(a:command, '\n', '\\n', 'g'), '%#') if has('gui_running') let Launcher = get(a:dict, 'launcher', get(g:, 'Fzf_launcher', get(g:, 'fzf_launcher', s:launcher))) let fmt = type(Launcher) == 2 ? call(Launcher, []) : Launcher - let command = printf(fmt, "'".substitute(a:command, "'", "'\"'\"'", 'g')."'") + let command = printf(fmt, "'".substitute(escaped, "'", "'\"'\"'", 'g')."'") else - let command = a:command + let command = escaped endif - execute 'silent !'.escape(substitute(command, '\n', '\\n', 'g'), '%#') + execute 'silent !'.command redraw! if v:shell_error " Do not print error message on exit status 1 |