Skip to content

Commit

Permalink
fix: use renamed apis
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Apr 25, 2024
1 parent a51e0a5 commit 3ad4dd7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/charm-freeze/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local M = {}

local function is_array(...)
if vim.fn.has("nvim-0.10") == 1 then
return vim.tbl_isarray(...)
return vim.isarray(...)
else
return vim.tbl_islist(...)
end
Expand Down Expand Up @@ -80,7 +80,7 @@ M.parse_options = function(opts)
end

local function populate_cmd(cmd, args, tbl, prefix)
for k,v in pairs(tbl) do
for k, v in pairs(tbl) do
-- handle margin and padding separately as tables
if k == "margin" or k == "padding" then
if type(v) == "table" then
Expand All @@ -89,7 +89,7 @@ local function populate_cmd(cmd, args, tbl, prefix)
end
-- table options ('border', 'font', 'shadow')
elseif type(v) == "table" and not is_array(v) then
populate_cmd(cmd, args, v, prefix .. k .. '.')
populate_cmd(cmd, args, v, prefix .. k .. ".")
-- handle anything that is not the command or language option
elseif k ~= "command" and k ~= "language" then
table.insert(cmd, "--" .. prefix .. string.gsub(k, "_", "-"))
Expand All @@ -115,7 +115,7 @@ M.get_arguments = function(args, options)
local cmd = {}

table.insert(cmd, options.command)
populate_cmd(cmd, args, options, '')
populate_cmd(cmd, args, options, "")

return cmd
end
Expand Down

0 comments on commit 3ad4dd7

Please sign in to comment.