mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -32,10 +32,10 @@ function! go#doc#OpenBrowser(...) abort
|
||||
let import = out["import"]
|
||||
let name = out["name"]
|
||||
let decl = out["decl"]
|
||||
|
||||
|
||||
let godoc_url = "https://godoc.org/" . import
|
||||
if decl !~ "^package"
|
||||
let godoc_url .= "#" . name
|
||||
let godoc_url .= "#" . name
|
||||
endif
|
||||
|
||||
echo godoc_url
|
||||
@ -92,13 +92,20 @@ function! s:GodocView(newposition, position, content) abort
|
||||
execute bufwinnr(s:buf_nr) . 'wincmd w'
|
||||
endif
|
||||
|
||||
" cap buffer height to 20, but resize it for smaller contents
|
||||
let max_height = 20
|
||||
let content_height = len(split(a:content, "\n"))
|
||||
if content_height > max_height
|
||||
exe 'resize ' . max_height
|
||||
if a:position == "split"
|
||||
" cap buffer height to 20, but resize it for smaller contents
|
||||
let max_height = 20
|
||||
let content_height = len(split(a:content, "\n"))
|
||||
if content_height > max_height
|
||||
exe 'resize ' . max_height
|
||||
else
|
||||
exe 'resize ' . content_height
|
||||
endif
|
||||
else
|
||||
exe 'resize ' . content_height
|
||||
" set a sane maximum width for vertical splits. In this case the minimum
|
||||
" that fits the godoc for package http without extra linebreaks and line
|
||||
" numbers on
|
||||
exe 'vertical resize 84'
|
||||
endif
|
||||
|
||||
setlocal filetype=godoc
|
||||
|
Reference in New Issue
Block a user