Skip to content

Commit

Permalink
fix: deprecation warnings on 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 16, 2024
1 parent a0aa3cc commit c6e2d96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/neoconf/build/schemas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function M.get_schema(schema)

local properties = {}

if vim.tbl_islist(config) then
if Util.islist(config) then
for _, c in pairs(config) do
vim.list_extend(properties, c.properties)
end
Expand Down
3 changes: 2 additions & 1 deletion lua/neoconf/schema.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local Settings = require("neoconf.settings")
local Util = require("neoconf.util")

local M = {}

Expand Down Expand Up @@ -57,7 +58,7 @@ function M.to_schema(value)
return { type = "number", default = value, description = "number" }
end

if vim.tbl_islist(value) then
if Util.islist(value) then
return { type = "array", default = value, description = "array" }
end

Expand Down
4 changes: 3 additions & 1 deletion lua/neoconf/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ local Config = require("neoconf.config")

local M = {}

M.islist = vim.islist or vim.tbl_islist

function M.merge(...)
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

local values = { ... }
Expand Down

0 comments on commit c6e2d96

Please sign in to comment.