Skip to content

Commit

Permalink
add floating border config option (liuchengxu#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
SethBarberee authored Oct 25, 2022
1 parent 9c3e31f commit 9ddb370
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autoload/vista/floating.vim
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ function! s:Display(msg, win_id) abort
let s:floating_opened_pos = getpos('.')
let [width, height, anchor, row, col] = s:CalculatePosition(a:msg)

let border = g:vista_floating_border

" silent is neccessary for the both strategy!
silent let s:floating_win_id = nvim_open_win(
\ s:floating_bufnr, v:true, {
Expand All @@ -145,6 +147,7 @@ function! s:Display(msg, win_id) abort
\ 'row': row + 0.4,
\ 'col': col - 5,
\ 'focusable': v:false,
\ 'border': border,
\ })

call nvim_buf_set_lines(s:floating_bufnr, 0, -1, 0, a:msg)
Expand Down
8 changes: 8 additions & 0 deletions doc/vista.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ g:vista_highlight_whole_line *g:vista_highlight_whole_lin
By default vista.vim will try to highlight the tag precisely in the vista window.
Set this to `1` to always higlight the whole line.


g:vista_floating_border *g:vista_floating_border*

Type: |String|
Default: `none`

See `nvim_open_win` for border options that may be used.

g:vista_floating_delay *g:vista_floating_delay*

Type: |Number|
Expand Down
1 change: 1 addition & 0 deletions plugin/vista.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ endif

let g:loaded_vista = 1

let g:vista_floating_border = get(g:, 'vista_floating_border', 'none')
let g:vista_sidebar_width = get(g:, 'vista_sidebar_width', 30)
let g:vista_sidebar_position = get(g:, 'vista_sidebar_position', 'vertical botright')
let g:vista_blink = get(g:, 'vista_blink', [2, 100])
Expand Down

0 comments on commit 9ddb370

Please sign in to comment.