Skip to content

Commit

Permalink
Merge pull request #1379 from Carpetsmoker/missing-gogetdoc
Browse files Browse the repository at this point in the history
Don't show window if "gogetdoc" command isn't found
  • Loading branch information
fatih authored Jul 24, 2017
2 parents 026728c + 64bd8dd commit 64bdf04
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 @@ -58,17 +58,21 @@ function! go#doc#OpenBrowser(...) abort
endfunction

function! go#doc#Open(newmode, mode, ...) abort
" With argument: run "godoc [arg]".
if len(a:000)
" check if we have 'godoc' and use it automatically
let bin_path = go#path#CheckBinPath('godoc')
if empty(bin_path)
return
endif

let command = printf("%s %s", bin_path, join(a:000, ' '))
let command = printf("%s %s", go#util#Shellescape(bin_path), join(a:000, ' '))
let out = go#util#System(command)
" Without argument: run gogetdoc on cursor position.
else
let out = s:gogetdoc(0)
if out == -1
return
endif
endif

if go#util#ShellError() != 0
Expand Down

0 comments on commit 64bdf04

Please sign in to comment.