[fzf#vim#with_preview] workaround system() newline (#557)

system() adds an extra newline which breaks the DOS shortname hack
for Neovim on Windows.
Suppress echo so the DOS shortname is the 1st line of the output

Related: https://github.com/neovim/neovim/issues/7788
This commit is contained in:
Jan Edmund Lazo 2018-01-02 04:28:17 -05:00 committed by Junegunn Choi
parent 3d33d4cd66
commit 7e92b73d03

View file

@ -37,7 +37,7 @@ let s:bin = {
let s:TYPE = {'dict': type({}), 'funcref': type(function('call')), 'string': type(''), 'list': type([])}
if s:is_win
if has('nvim')
let s:bin.preview = split(system('for %A in ("'.s:bin.preview.'") do echo %~sA'), "\n")[1]
let s:bin.preview = split(system('for %A in ("'.s:bin.preview.'") do @echo %~sA'), "\n")[0]
else
let s:bin.preview = fnamemodify(s:bin.preview, ':8')
endif