Skip to content
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

Add path convertion for native-win-vim with Cygwin support #1092

Merged
merged 3 commits into from
May 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion autoload/go/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,22 @@ function! go#path#CheckBinPath(binpath) abort

let $PATH = old_path

return go_bin_path . go#util#PathSep() . basename
return go#path#SupportCygwin(go_bin_path . go#util#PathSep() . basename)
endfunction

" When you are using:
" 1) Windows system
" 2) Has cygpath exeuctable
" 3) Use *sh* as 'shell'
"
" This function would convert your <path> to $(cygpath '<path>') to make cygwin
" working in shell of cygwin way
function! go#path#SupportCygwin(bin_path)
if !go#util#IsWin() || !executable('cygpath') || &shell !~ '.*sh.*'
return a:bin_path
endif

return printf("$(cygpath '%s')", a:bin_path)
endfunction

" vim: sw=2 ts=2 et