Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 8903ab6

Browse files
committed
Leverage neovim's new api for floating windows
with borders. This applies to auto_hover and signature_help
1 parent 22624f0 commit 8903ab6

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

doc/completion-nvim.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ g:completion_enable_auto_signature *g:completion_enable_auto_signature*
123123

124124
default value: 1
125125

126+
g:completion_popup_border *g:completion_popup_border*
127+
128+
By default border for auto hover popup and signature help popup
129+
are set to single. You can change it as per neovim's popup/preview
130+
window sepcifications.
131+
132+
available options: 'single', 'double', 'rounded', 'solid' and 'shadow'
133+
134+
default value: 'single'
135+
126136
g:completion_enable_auto_paren *g:completion_enable_auto_paren*
127137

128138
Enable the auto insert parenthesis feature. completion-nvim will

lua/completion/hover.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ local make_floating_popup_options = function(width, height, opts)
8181
focusable = false,
8282
style = 'minimal',
8383
width = width,
84+
border = vim.g.completion_popup_border
8485
}
8586
end
8687

lua/completion/signature_help.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ M.autoOpenSignatureHelp = function()
4646

4747
-- if `lines` can be trimmed, it is modified in place
4848
local trimmed_lines_filetype = vim.lsp.util.try_trim_markdown_code_blocks(lines)
49+
local opts = {border = vim.g.completion_popup_border}
4950
local bufnr, _ = vim.lsp.util.open_floating_preview(
5051
-- TODO show popup when signatures is empty?
5152
vim.lsp.util.trim_empty_lines(lines),
5253
trimmed_lines_filetype,
53-
{}
54+
opts
5455
)
5556
-- setup a variable for floating window, fix #223
5657
vim.api.nvim_buf_set_var(bufnr, "lsp_floating", true)

plugin/completion.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ if ! exists('g:completion_enable_auto_hover')
2525
let g:completion_enable_auto_hover = 1
2626
endif
2727

28+
if ! exists('g:completion_popup_border')
29+
let g:completion_popup_border = 'single'
30+
endif
31+
2832
if ! exists('g:completion_docked_hover')
2933
let g:completion_docked_hover = 0
3034
endif

0 commit comments

Comments
 (0)