[vim] Fix FZF_DEFAULT_COMMAND on Windows

Close #847. Patch submitted by @wontoncc.
This commit is contained in:
Junegunn Choi 2017-02-18 18:16:34 +09:00
parent 3d74d277aa
commit 9526594905
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -291,9 +291,9 @@ try
endtry endtry
if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND) if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND)
let temps.source = tempname() let temps.source = tempname().(s:is_win ? '.bat' : '')
call writefile(split($FZF_DEFAULT_COMMAND, "\n"), temps.source) call writefile(split($FZF_DEFAULT_COMMAND, "\n"), temps.source)
let dict.source = (empty($SHELL) ? &shell : $SHELL) . ' ' . s:shellesc(temps.source) let dict.source = (empty($SHELL) ? &shell : $SHELL) . (s:is_win ? ' /c ' : ' ') . s:shellesc(temps.source)
endif endif
if has_key(dict, 'source') if has_key(dict, 'source')