Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: godoc popup border style #2900

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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