Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Jack O'Connor · committed by Junegunn Choi · parent e89eebb · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:plugin/fzf.vim+1 added-1 removed
364 unmodified lines
365 if has_key(dict, 'source')366 let source = dict.source367 let type = type(source)368 if type == 1369 let prefix = source.'|'369 let prefix = '( '.source.' )|'370 elseif type == 3371 let temps.input = s:fzf_tempname()372 call writefile(source, temps.input)373 let prefix = (s:is_win ? 'type ' : 'cat ').fzf#shellescape(temps.input).'|'
405 unmodified lines