-
-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use fnamemodify in Cygwin for Windows paths #386
Conversation
Thanks, this makes me wonder, would it make sense to do |
Sure, since it simplifies I see |
Need |
It's only for the cases where Let's just make sure that we're on the same page. diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 99fda1f..64e8cd3 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -360,6 +360,8 @@ try
if has('nvim') && !has_key(dict, 'dir')
let dict.dir = s:fzf_getcwd()
+ elseif has('win32unix')
+ let dict.dir = fnamemodify(dir, ':p')
endif
if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND)
@@ -765,8 +767,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 |
By the way, I wonder if neovim runs on cygwin. |
fixup. 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 |
Thanks for the reminder. I use vim-rooter so thanks for the patch :)
It does if you don't use mintty. |
The prompt works for me and is better for me because if I pass a Windows-style path to |
Okay, thanks for the feedback. Let me push the fix. |
Thanks. |
From initial testing, only
Files
andGFiles
require fnamemodify.I can't test
Locate
in cygwin because it requires updatedb and locate needs a regularly updated database. Windows has its own indexing for explorer.exe but I disabled it in my system for performance. I'll revist it in #372