From 97d4aba3e705144d9da76742fd9668f3e2f7b763 Mon Sep 17 00:00:00 2001 From: gonotes Date: Fri, 16 Oct 2015 09:51:07 +0800 Subject: [PATCH] Show multiple definition position for GoDef command(need godef support) --- autoload/go/def.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index 6b1c716878..1533b77f58 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -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(...) @@ -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