[vim] Add parens around piped source commands (#1029)

Previously a command like `echo a && echo b` would get transformed into
`echo a && echo b | fzf`, which only pipes the output of the second
command. Adding parentheses around the source command avoids this issue,
and works on both Unix and Windows.
This commit is contained in:
Jack O'Connor 2017-08-28 09:32:13 -04:00 committed by Junegunn Choi
parent e89eebb7ba
commit b27dc3eb17

View File

@ -366,7 +366,7 @@ try
let source = dict.source let source = dict.source
let type = type(source) let type = type(source)
if type == 1 if type == 1
let prefix = source.'|' let prefix = '( '.source.' )|'
elseif type == 3 elseif type == 3
let temps.input = s:fzf_tempname() let temps.input = s:fzf_tempname()
call writefile(source, temps.input) call writefile(source, temps.input)