[[B]Commit] Fix preview command for fish shell (#518)

* Fish shell doesn't like <<<

Echo to pipe instead

* Only return the first match

Useful if the commit message has a project tracker id that looks
similar to a git commit hash
This commit is contained in:
Niraj Thapaliya 2017-11-23 22:18:55 -06:00 committed by Junegunn Choi
parent 45d39f5711
commit d0042b9dee

View file

@ -1124,7 +1124,7 @@ function! s:commits(buffer_local, args)
if !s:is_win && &columns > s:wide
call extend(options.options,
\ ['--preview', 'grep -o "[a-f0-9]\{7,\}" <<< {} | xargs git show --format=format: --color=always | head -200'])
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -200'])
endif
return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)