From 5efdeccdbbf9dba6296f16de65efc6c4ad3a22a9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 9 Jun 2017 12:00:59 +0900 Subject: [PATCH] [vim] Expand 'dir' on Cygwin to handle Windows-style paths See https://github.com/junegunn/fzf/pull/933#discussion_r120011934 Close https://github.com/junegunn/fzf.vim/pull/386 --- plugin/fzf.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 99fda1f..bad7449 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -361,6 +361,9 @@ try if has('nvim') && !has_key(dict, 'dir') let dict.dir = s:fzf_getcwd() endif + if has('win32unix') && has_key(dict, 'dir') + let dict.dir = fnamemodify(dict.dir, ':p') + endif if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND) let temps.source = s:fzf_tempname().(s:is_win ? '.bat' : '') @@ -765,8 +768,6 @@ function! s:cmd(bang, ...) abort let opts.dir = substitute(substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g'), '[/\\]*$', '/', '') if s:is_win && !&shellslash let opts.dir = substitute(opts.dir, '/', '\\', 'g') - elseif has('win32unix') - let opts.dir = fnamemodify(opts.dir, ':p') endif let prompt = opts.dir else