[vim] Fix double path separator issue on Windows

Fix https://github.com/junegunn/fzf.vim/issues/1141
This commit is contained in:
Junegunn Choi 2020-11-05 18:14:45 +09:00
parent e3e76fa8c5
commit d099941360
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -283,7 +283,8 @@ function! s:common_sink(action, lines) abort
let cwd = exists('w:fzf_pushd') ? w:fzf_pushd.dir : expand('%:p:h')
for item in a:lines
if item[0] != '~' && item !~ (s:is_win ? '^[A-Z]:\' : '^/')
let item = join([cwd, item], (s:is_win ? '\' : '/'))
let sep = s:is_win ? '\' : '/'
let item = join([cwd, item], cwd[len(cwd)-1] == sep ? '' : sep)
endif
if empty
execute 'e' s:escape(item)