Skip to content

Commit 4edc277

Browse files
marks0mmersMark Sommers
andauthored
fix: deprecated calls to vim.validate (#434)
* Fix deprecated calls to vim.validate * Added check to determine which format to use for validate --------- Co-authored-by: Mark Sommers <mark_sommers@apple.com>
1 parent da58752 commit 4edc277

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lua/dapui/config/init.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,17 @@ local user_config = default_config
150150
local function fill_elements(area)
151151
area = vim.deepcopy(area)
152152
local filled = {}
153-
vim.validate({
154-
size = { area.size, "number" },
155-
elements = { area.elements, "table" },
156-
position = { area.position, "string" },
157-
})
153+
if vim.fn.has("nvim-0.11") then
154+
vim.validate("size", area.size, "number")
155+
vim.validate("elements", area.elements, "table")
156+
vim.validate("position", area.position, "string")
157+
else
158+
vim.validate({
159+
size = { area.size, "number" },
160+
elements = { area.elements, "table" },
161+
position = { area.position, "string" },
162+
})
163+
end
158164
for i, element in ipairs(area.elements) do
159165
if type(element) == "string" then
160166
filled[i] = { id = element, size = 1 / #area.elements }

0 commit comments

Comments
 (0)