aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-06-05 15:00:07 -0700
committerGitHub <noreply@github.com>2021-06-05 15:00:07 -0700
commitf214c19e2b463c88b3c8320346fcb0b050617fb1 (patch)
tree991deee1c9a18f48fd358d94184962b1b806d248 /runtime/lua/vim/lsp/util.lua
parent21ecde17286c439a123d3cf87af7b33b927c9939 (diff)
parent351050a10fe669dcb09ff6fa6116b24b8a60a3d6 (diff)
downloadrneovim-f214c19e2b463c88b3c8320346fcb0b050617fb1.tar.gz
rneovim-f214c19e2b463c88b3c8320346fcb0b050617fb1.tar.bz2
rneovim-f214c19e2b463c88b3c8320346fcb0b050617fb1.zip
Merge pull request #14707 from ray-x/master
fix(lsp): floating window border size for string type
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index a986bd6f81..5a0bcd258e 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -40,9 +40,12 @@ local function get_border_size(opts)
local width = 0
if type(border) == 'string' then
- -- 'single', 'double', etc.
- height = 2
- width = 2
+ local border_size = {none = {0, 0}, single = {2, 2}, double = {2, 2}, shadow = {1, 1}}
+ if border_size[border] == nil then
+ error("floating preview border is not correct. Please refer to the docs |vim.api.nvim_open_win()|"
+ .. vim.inspect(border))
+ end
+ height, width = unpack(border_size[border])
else
local function border_width(id)
if type(border[id]) == "table" then