Skip to content
Myr

[vim] Expand 'dir' on Cygwin to handle Windows-style paths

Before adoption: this commit came in with the history the project adopted, so no landing records it.

See https://github.com/junegunn/fzf/pull/933#discussion_r120011934 Close https://github.com/junegunn/fzf.vim/pull/386

authored by Junegunn Choi · committed by Junegunn Choi · parent 050777b · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:plugin/fzf.vim+3 added-2 removed
359 unmodified lines
360361 if has('nvim') && !has_key(dict, 'dir')362 let dict.dir = s:fzf_getcwd()363 endif364 if has('win32unix') && has_key(dict, 'dir')365 let dict.dir = fnamemodify(dict.dir, ':p')366 endif367368 if !has_key(dict, 'source') && !empty($FZF_DEFAULT_COMMAND)369 let temps.source = s:fzf_tempname().(s:is_win ? '.bat' : '')370 call writefile(s:wrap_cmds(split($FZF_DEFAULT_COMMAND, "\n")), temps.source)
396 unmodified lines
767 if len(args) && isdirectory(expand(args[-1]))768 let opts.dir = substitute(substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g'), '[/\\]*$', '/', '')769 if s:is_win && !&shellslash770 let opts.dir = substitute(opts.dir, '/', '\\', 'g')768 elseif has('win32unix')769 let opts.dir = fnamemodify(opts.dir, ':p')771 endif772 let prompt = opts.dir773 else774 let prompt = s:shortpath()
10 unmodified lines