1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated vimrc

This commit is contained in:
amix
2015-07-13 11:22:46 +01:00
parent 9a2843c2a5
commit d7752b59ae
301 changed files with 4699 additions and 7969 deletions

View File

@ -71,6 +71,14 @@ function! s:godocWord(args)
return [pkg, exported_name]
endfunction
function! s:godocNotFound(content)
if len(a:content) == 0
return 1
endif
return a:content =~# '^.*: no such file or directory\n$'
endfunction
function! go#doc#OpenBrowser(...)
let pkgs = s:godocWord(a:000)
if empty(pkgs)
@ -97,7 +105,7 @@ function! go#doc#Open(newmode, mode, ...)
let command = g:go_doc_command . ' ' . g:go_doc_options . ' ' . pkg
silent! let content = system(command)
if v:shell_error || !len(content)
if v:shell_error || s:godocNotFound(content)
echo 'No documentation found for "' . pkg . '".'
return -1
endif