From 15548369edf1ac5b392383654193035e8d0ead4e Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 19 Oct 2022 15:08:44 +0200 Subject: [PATCH] Revert shellescape behaviour, explicitly avoid escaping on :Buffers. --- plugin/fzf.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 0ca8e8e5514..47bf4551aea 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -94,7 +94,7 @@ function! s:shellesc_cmd(arg) endfunction function! fzf#shellescape(arg, ...) - let shell = get(a:000, 0, s:is_win_cmd ? 'cmd.exe' : 'sh') + let shell = get(a:000, 0, s:is_win ? 'cmd.exe' : 'sh') if shell =~# 'cmd.exe$' return s:shellesc_cmd(a:arg) endif @@ -486,7 +486,9 @@ try elseif type == 3 let temps.input = s:fzf_tempname() call s:writefile(source, temps.input) - let source_command = (s:is_win_cmd ? 'type ' : 'cat ').fzf#shellescape(temps.input) + " Disable shell escape for git bash, as it breaks the command here + let source_command = (s:is_win_cmd ? 'type ' : 'cat ') + \(!s:is_win || !exists('$SHELL')).fzf#shellescape(temps.input) else throw 'Invalid source type' endif