Skip to content

Commit f729a56

Browse files
committed
Previous attempts failed. Scope the change more tightly.
1 parent ab0ba4f commit f729a56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/fzf.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ if exists('g:loaded_fzf')
2626
endif
2727
let g:loaded_fzf = 1
2828

29+
let s:is_win = has('win32') || has('win64')
2930
" On Windows, cmd.exe does not define a `SHELL` env var, whereas git-bash does.
30-
" Treat git-bash environment like a Unix shell.
31-
let s:is_win = (has('win32') || has('win64')) && !exists('$SHELL')
31+
let s:is_win_cmd = s:is_win && !exists('$SHELL')
3232
if s:is_win && &shellslash
3333
set noshellslash
3434
let s:base_dir = expand('<sfile>:h:h')
@@ -94,7 +94,7 @@ function! s:shellesc_cmd(arg)
9494
endfunction
9595

9696
function! fzf#shellescape(arg, ...)
97-
let shell = get(a:000, 0, s:is_win ? 'cmd.exe' : 'sh')
97+
let shell = get(a:000, 0, s:is_win_cmd ? 'cmd.exe' : 'sh')
9898
if shell =~# 'cmd.exe$'
9999
return s:shellesc_cmd(a:arg)
100100
endif
@@ -486,7 +486,7 @@ try
486486
elseif type == 3
487487
let temps.input = s:fzf_tempname()
488488
call s:writefile(source, temps.input)
489-
let source_command = (s:is_win ? 'type ' : 'cat ').fzf#shellescape(temps.input)
489+
let source_command = (s:is_win_cmd ? 'type ' : 'cat ').fzf#shellescape(temps.input)
490490
else
491491
throw 'Invalid source type'
492492
endif

0 commit comments

Comments
 (0)