mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
[gvim] Fix #342 - Should not escape launcher part of the command
This commit is contained in:
parent
62e01a2a62
commit
ac160f98a8
@ -217,14 +217,15 @@ let s:launcher = function('s:xterm_launcher')
|
|||||||
function! s:execute(dict, command, temps)
|
function! s:execute(dict, command, temps)
|
||||||
call s:pushd(a:dict)
|
call s:pushd(a:dict)
|
||||||
silent! !clear 2> /dev/null
|
silent! !clear 2> /dev/null
|
||||||
|
let escaped = escape(substitute(a:command, '\n', '\\n', 'g'), '%#')
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
let Launcher = get(a:dict, 'launcher', get(g:, 'Fzf_launcher', get(g:, 'fzf_launcher', s:launcher)))
|
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 fmt = type(Launcher) == 2 ? call(Launcher, []) : Launcher
|
||||||
let command = printf(fmt, "'".substitute(a:command, "'", "'\"'\"'", 'g')."'")
|
let command = printf(fmt, "'".substitute(escaped, "'", "'\"'\"'", 'g')."'")
|
||||||
else
|
else
|
||||||
let command = a:command
|
let command = escaped
|
||||||
endif
|
endif
|
||||||
execute 'silent !'.escape(substitute(command, '\n', '\\n', 'g'), '%#')
|
execute 'silent !'.command
|
||||||
redraw!
|
redraw!
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
" Do not print error message on exit status 1
|
" Do not print error message on exit status 1
|
||||||
|
Loading…
Reference in New Issue
Block a user