diff --git a/lua/distant-core/api.lua b/lua/distant-core/api.lua index 952e79f..6e612a1 100644 --- a/lua/distant-core/api.lua +++ b/lua/distant-core/api.lua @@ -110,7 +110,7 @@ end --- @param payload table --- @return boolean local function verify_dir_read(payload) - return payload.type == 'dir_entries' and vim.tbl_islist(payload.entries) and vim.tbl_islist(payload.errors) + return payload.type == 'dir_entries' and vim.islist(payload.entries) and vim.islist(payload.errors) end --- @param payload table @@ -134,7 +134,7 @@ end --- @param payload table --- @return boolean local function verify_file_read(payload) - return payload.type == 'blob' and vim.tbl_islist(payload.data) + return payload.type == 'blob' and vim.islist(payload.data) end --- @param payload table @@ -307,7 +307,7 @@ function M:batch(opts, cb) opts.interval = nil -- Validate the payload by checking it contains types - assert(vim.tbl_islist(opts), 'Batch not provided a list of payloads') + assert(vim.islist(opts), 'Batch not provided a list of payloads') --- @type distant.core.api.RequestHandlers[] local handlers = {} for idx, payload in ipairs(opts) do @@ -323,7 +323,7 @@ function M:batch(opts, cb) payload = opts, header = { sequence = sequence }, verify = function(payload) - return type(payload) == 'table' and vim.tbl_islist(payload) + return type(payload) == 'table' and vim.islist(payload) end, map = function(payload) -- Map errors versus regular responses diff --git a/lua/distant-core/api/transport.lua b/lua/distant-core/api/transport.lua index 5ad7f89..9601116 100644 --- a/lua/distant-core/api/transport.lua +++ b/lua/distant-core/api/transport.lua @@ -441,7 +441,7 @@ function M:__handle_response(msg) --- @return T local function clean_payload(payload) if type(payload) == 'table' then - if vim.tbl_islist(payload) then + if vim.islist(payload) then return vim.tbl_map(clean_payload, payload) else for key, value in pairs(payload) do diff --git a/lua/distant-core/builder/cmd.lua b/lua/distant-core/builder/cmd.lua index 945fea0..0a17845 100644 --- a/lua/distant-core/builder/cmd.lua +++ b/lua/distant-core/builder/cmd.lua @@ -27,7 +27,7 @@ function M:new(cmd, opts) instance.__cmd = cmd end - if vim.tbl_islist(opts.allowed) then + if vim.islist(opts.allowed) then instance.__allowed = {} for _, key in ipairs(opts.allowed) do instance.__allowed[key] = true diff --git a/lua/distant-core/ui/nodes.lua b/lua/distant-core/ui/nodes.lua index 41e9cf5..6201e7e 100644 --- a/lua/distant-core/ui/nodes.lua +++ b/lua/distant-core/ui/nodes.lua @@ -286,7 +286,7 @@ function M.Table(rows, extra) -- For neovim 0.10+, `tbl_isarray` is the new `tbl_islist` whereas on earlier versions -- there is no `tbl_isarray`; so, check if we have the new function and use it otherwise -- fall back to the old function. - local isarray = vim.tbl_isarray or vim.tbl_islist + local isarray = vim.isarray or vim.islist if type(extra) == 'table' and isarray(extra) then --- @type distant.core.ui.INode[] diff --git a/lua/distant-core/utils.lua b/lua/distant-core/utils.lua index 0b88797..787895e 100644 --- a/lua/distant-core/utils.lua +++ b/lua/distant-core/utils.lua @@ -42,7 +42,7 @@ M.cache_path = function(path) M.plugin_name() ) - if type(path) == 'table' and vim.tbl_islist(path) then + if type(path) == 'table' and vim.islist(path) then for _, component in ipairs(path) do full_path = full_path .. M.seperator() .. component end @@ -63,7 +63,7 @@ M.data_path = function(path) M.plugin_name() ) - if type(path) == 'table' and vim.tbl_islist(path) then + if type(path) == 'table' and vim.islist(path) then for _, component in ipairs(path) do full_path = full_path .. M.seperator() .. component end @@ -251,7 +251,7 @@ end --- @return string #The path as a string M.join_path = function(sep, paths) assert(type(sep) == 'string', 'sep must be a string') - assert(vim.tbl_islist(paths), 'paths must be a list') + assert(vim.islist(paths), 'paths must be a list') local path = '' for _, component in ipairs(paths) do diff --git a/spec/e2e/driver.lua b/spec/e2e/driver.lua index a08ae08..1d11b17 100644 --- a/spec/e2e/driver.lua +++ b/spec/e2e/driver.lua @@ -601,7 +601,7 @@ function M:new_dir_fixture(opts) local file = rd:file(item) assert(file:touch(), 'Failed to create file: ' .. file:path()) end - elseif vim.tbl_islist(item) and #item == 2 then + elseif vim.islist(item) and #item == 2 then local symlink = rd:symlink(item[1]) local target = rd:file(item[2]):path() assert(symlink:make(target), 'Failed to create symlink: ' .. symlink:path() .. ' to ' .. target)