[vim] Prepend @echo off to $FZF_DEFAULT_COMMAND on Windows (#847)

This commit is contained in:
Junegunn Choi 2017-02-18 21:58:03 +09:00
parent 9526594905
commit c2db67c1c0
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

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