mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-19 12:50:22 -07:00
[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
This commit is contained in:
parent
050777b8c4
commit
5efdeccdbb
@ -361,6 +361,9 @@ try
|
|||||||
if has('nvim') && !has_key(dict, 'dir')
|
if has('nvim') && !has_key(dict, 'dir')
|
||||||
let dict.dir = s:fzf_getcwd()
|
let dict.dir = s:fzf_getcwd()
|
||||||
endif
|
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)
|
if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND)
|
||||||
let temps.source = s:fzf_tempname().(s:is_win ? '.bat' : '')
|
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'), '[/\\]*$', '/', '')
|
let opts.dir = substitute(substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g'), '[/\\]*$', '/', '')
|
||||||
if s:is_win && !&shellslash
|
if s:is_win && !&shellslash
|
||||||
let opts.dir = substitute(opts.dir, '/', '\\', 'g')
|
let opts.dir = substitute(opts.dir, '/', '\\', 'g')
|
||||||
elseif has('win32unix')
|
|
||||||
let opts.dir = fnamemodify(opts.dir, ':p')
|
|
||||||
endif
|
endif
|
||||||
let prompt = opts.dir
|
let prompt = opts.dir
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user