fix: deprecation warnings on 0.11

This commit is contained in:
Folke Lemaitre 2024-05-16 21:55:18 +02:00
parent a0aa3cc5e1
commit c6e2d969b8
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
3 changed files with 6 additions and 3 deletions

View File

@ -96,7 +96,7 @@ function M.get_schema(schema)
local properties = {} local properties = {}
if vim.tbl_islist(config) then if Util.islist(config) then
for _, c in pairs(config) do for _, c in pairs(config) do
vim.list_extend(properties, c.properties) vim.list_extend(properties, c.properties)
end end

View File

@ -1,4 +1,5 @@
local Settings = require("neoconf.settings") local Settings = require("neoconf.settings")
local Util = require("neoconf.util")
local M = {} local M = {}
@ -57,7 +58,7 @@ function M.to_schema(value)
return { type = "number", default = value, description = "number" } return { type = "number", default = value, description = "number" }
end end
if vim.tbl_islist(value) then if Util.islist(value) then
return { type = "array", default = value, description = "array" } return { type = "array", default = value, description = "array" }
end end

View File

@ -2,9 +2,11 @@ local Config = require("neoconf.config")
local M = {} local M = {}
M.islist = vim.islist or vim.tbl_islist
function M.merge(...) function M.merge(...)
local function can_merge(v) local function can_merge(v)
return type(v) == "table" and (vim.tbl_isempty(v) or not vim.tbl_islist(v)) return type(v) == "table" and (vim.tbl_isempty(v) or not M.islist(v))
end end
local values = { ... } local values = { ... }