fix(lsp): floating window border size for string type 'none' and 'shadow'

This commit is contained in:
ray-x
2021-06-02 20:41:25 +10:00
parent 68d40388f3
commit 351050a10f

View File

@@ -40,9 +40,12 @@ local function get_border_size(opts)
local width = 0 local width = 0
if type(border) == 'string' then if type(border) == 'string' then
-- 'single', 'double', etc. local border_size = {none = {0, 0}, single = {2, 2}, double = {2, 2}, shadow = {1, 1}}
height = 2 if border_size[border] == nil then
width = 2 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 else
local function border_width(id) local function border_width(id)
if type(border[id]) == "table" then if type(border[id]) == "table" then