Skip to content

Commit

Permalink
Merge pull request #2276 from bhcleek/doc/browse/method
Browse files Browse the repository at this point in the history
doc: set method anchor correctly
  • Loading branch information
bhcleek authored May 7, 2019
2 parents 8c32f9f + 975401b commit 0418a0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ function! go#doc#OpenBrowser(...) abort

let godoc_url = go#config#DocUrl()
let godoc_url .= "/" . import
if decl !~ "^package"
let godoc_url .= "#" . name
if decl !~ '^package'
let anchor = name
if decl =~ '^func ('
let anchor = substitute(decl, '^func ([^ ]\+ \*\?\([^)]\+\)) ' . name . '(.*', '\1', '') . "." . name
endif
let godoc_url .= "#" . anchor
endif

call go#util#OpenBrowser(godoc_url)
Expand Down

0 comments on commit 0418a0c

Please sign in to comment.