Skip to content

Commit

Permalink
chore: godoc border style
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkai committed May 28, 2020
1 parent 9fa8d1e commit 6e7a0bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
10 changes: 8 additions & 2 deletions autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
let s:cpo_save = &cpo
set cpo&vim

scriptencoding utf-8

let s:buf_nr = -1

function! go#doc#OpenBrowser(...) abort
Expand Down Expand Up @@ -61,10 +63,14 @@ function! s:GodocView(newposition, position, content) abort
if exists('*popup_atcursor') && exists('*popup_clear')
call popup_clear()

let borderchars = ['-', '|', '-', '|', '+', '+', '+', '+']
if &encoding == "utf-8"
let borderchars = ['', '', '', '', '', '', '', '']
endif
call popup_atcursor(split(a:content, '\n'), {
\ 'padding': [1, 1, 1, 1],
\ 'borderchars': ['-','|','-','|','+','+','+','+'],
\ "border": [1, 1, 1, 1],
\ 'borderchars': get(g:, 'go_doc_popup_border', borderchars),
\ 'border': [1, 1, 1, 1],
\ })
elseif has('nvim') && exists('*nvim_open_win')
let lines = split(a:content, '\n')
Expand Down
10 changes: 9 additions & 1 deletion doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,14 @@ Use this option to use the popup-window for |K| and |:GoDoc|, rather than the
let g:go_doc_popup_window = 0
<

*'g:go_doc_popup_border'*

Use this option to custome border chars of the popup-window for |K|
and |:GoDoc|, Default is empty. Example usage, set the border as rounded:
>
let g:go_doc_popup_border = ['─', '│', '─', '│', '╭', '╮', '╯', '╰']
<

*'g:go_def_mode'*

Use this option to define the command to be used for |:GoDef|. By default
Expand All @@ -1486,7 +1494,7 @@ other packages. Valid options are `gopls` and `guru`. By default it's `gopls`.
<
*'g:go_implements_mode'*

Use this option to define the command to be used for |:GoImplements|.
Use this option to define the command to be used for |:GoImplements|.
The Implements feature in gopls is still new and being worked upon.
Valid options are `gopls` and `guru`. By default it's `guru`.
>
Expand Down

0 comments on commit 6e7a0bd

Please sign in to comment.