diff --git a/autoload/go/def.vim b/autoload/go/def.vim index cb922bcc0c..ae9bf11e4a 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -30,10 +30,11 @@ function! go#def#Jump(...) let old_gopath = $GOPATH let $GOPATH = go#path#Detect() - let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg) + let fname = fnamemodify(expand("%"), ':p:gs?\\?/?') + let command = bin_path . " -f=" . shellescape(fname) . " -i " . shellescape(arg) " get output of godef - let out=s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding())) + let out = s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding())) " jump to it call s:godefJump(out, "") @@ -52,10 +53,11 @@ function! go#def#JumpMode(mode) let old_gopath = $GOPATH let $GOPATH = go#path#Detect() - let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg) + let fname = fnamemodify(expand("%"), ':p:gs?\\?/?') + let command = bin_path . " -f=" . shellescape(fname) . " -i " . shellescape(arg) " get output of godef - let out=s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding())) + let out = s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding())) call s:godefJump(out, a:mode) let $GOPATH = old_gopath @@ -83,7 +85,7 @@ function! s:godefJump(out, mode) let &errorformat = "%f:%l:%c" if a:out =~ 'godef: ' - let out=substitute(a:out, go#util#LineEnding() . '$', '', '') + let out = substitute(a:out, go#util#LineEnding() . '$', '', '') echom out else let parts = split(a:out, ':')