Skip to content

Commit

Permalink
Show multiple definition position for GoDef command(need godef support)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonotes authored and hejian committed Oct 16, 2015
1 parent d010758 commit 97d4aba
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions autoload/go/def.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ if !exists("g:go_godef_bin")
let g:go_godef_bin = "godef"
endif

func! s:qflistSecond(output)
cgetexpr split(a:output, "\n")
cwindow
endfun

" modified and improved version of vim-godef
function! go#def#Jump(...)
Expand All @@ -25,9 +29,9 @@ function! go#def#Jump(...)

" get output of godef
let out=system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding()))

" jump to it
call s:godefJump(out, "")
call s:qflistSecond(out)
" jump to it
"call s:godefJump(out, "")
let $GOPATH = old_gopath
endfunction

Expand Down

0 comments on commit 97d4aba

Please sign in to comment.