aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorray-x <rayx.cn@gmail.com>2021-06-02 20:41:25 +1000
committerray-x <rayx.cn@gmail.com>2021-06-02 20:44:13 +1000
commit351050a10fe669dcb09ff6fa6116b24b8a60a3d6 (patch)
treebf1cdd6881328b7058dc2168ac06587b6eb61a4c /runtime/lua/vim/lsp/util.lua
parent68d40388f356587726ea7db83f87846dfaecf9d9 (diff)
downloadrneovim-351050a10fe669dcb09ff6fa6116b24b8a60a3d6.tar.gz
rneovim-351050a10fe669dcb09ff6fa6116b24b8a60a3d6.tar.bz2
rneovim-351050a10fe669dcb09ff6fa6116b24b8a60a3d6.zip
fix(lsp): floating window border size for string type 'none' and 'shadow'
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