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

Commit 75c31b2

Browse files
committed
Allow not setting border
1 parent 8903ab6 commit 75c31b2

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

doc/completion-nvim.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ g:completion_enable_auto_signature *g:completion_enable_auto_signature*
125125

126126
g:completion_popup_border *g:completion_popup_border*
127127

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
128+
This variable sets border for auto hover popup and signature help popup.
129+
The variable is not created by default so that there is no border by
130+
default. You can set it as per neovim's popup/preview
130131
window sepcifications.
131132

132133
available options: 'single', 'double', 'rounded', 'solid' and 'shadow'
133134

134-
default value: 'single'
135+
default value: variable not declared
135136

136137
g:completion_enable_auto_paren *g:completion_enable_auto_paren*
137138

lua/completion/hover.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ local make_floating_popup_options = function(width, height, opts)
7373
col = opts.col - width - 1
7474
end
7575

76+
local default_border = {
77+
{"", "NormalFloat"},
78+
{"", "NormalFloat"},
79+
{"", "NormalFloat"},
80+
{" ", "NormalFloat"},
81+
{"", "NormalFloat"},
82+
{"", "NormalFloat"},
83+
{"", "NormalFloat"},
84+
{" ", "NormalFloat"},
85+
}
86+
7687
return {
7788
col = col,
7889
height = height,
@@ -81,7 +92,7 @@ local make_floating_popup_options = function(width, height, opts)
8192
focusable = false,
8293
style = 'minimal',
8394
width = width,
84-
border = vim.g.completion_popup_border
95+
border = vim.g.completion_popup_border or default_border
8596
}
8697
end
8798

lua/completion/signature_help.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ 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}
49+
local opts = {}
50+
if vim.g.completion_popup_border then
51+
opts.border = vim.g.completion_popup_border
52+
end
5053
local bufnr, _ = vim.lsp.util.open_floating_preview(
5154
-- TODO show popup when signatures is empty?
5255
vim.lsp.util.trim_empty_lines(lines),

plugin/completion.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ 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-
3228
if ! exists('g:completion_docked_hover')
3329
let g:completion_docked_hover = 0
3430
endif

0 commit comments

Comments
 (0)