Skip to content

Commit 6e7a0bd

Browse files
committed
chore: godoc border style
1 parent 9fa8d1e commit 6e7a0bd

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

autoload/go/doc.vim

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
let s:cpo_save = &cpo
77
set cpo&vim
88

9+
scriptencoding utf-8
10+
911
let s:buf_nr = -1
1012

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

66+
let borderchars = ['-', '|', '-', '|', '+', '+', '+', '+']
67+
if &encoding == "utf-8"
68+
let borderchars = ['', '', '', '', '', '', '', '']
69+
endif
6470
call popup_atcursor(split(a:content, '\n'), {
6571
\ 'padding': [1, 1, 1, 1],
66-
\ 'borderchars': ['-','|','-','|','+','+','+','+'],
67-
\ "border": [1, 1, 1, 1],
72+
\ 'borderchars': get(g:, 'go_doc_popup_border', borderchars),
73+
\ 'border': [1, 1, 1, 1],
6874
\ })
6975
elseif has('nvim') && exists('*nvim_open_win')
7076
let lines = split(a:content, '\n')

doc/vim-go.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,14 @@ Use this option to use the popup-window for |K| and |:GoDoc|, rather than the
14651465
let g:go_doc_popup_window = 0
14661466
<
14671467

1468+
*'g:go_doc_popup_border'*
1469+
1470+
Use this option to custome border chars of the popup-window for |K|
1471+
and |:GoDoc|, Default is empty. Example usage, set the border as rounded:
1472+
>
1473+
let g:go_doc_popup_border = ['─', '│', '─', '│', '╭', '╮', '╯', '╰']
1474+
<
1475+
14681476
*'g:go_def_mode'*
14691477

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

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

0 commit comments

Comments
 (0)