Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed vim.tbl_islist to vim.islist #88

Merged
merged 1 commit into from
May 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lua/dial/util.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- utils
local M = {}

-- NOTE: Needed until compatibility with Neovim 0.9 is dropped
local islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist

---@generic T
---@param cond boolean
---@param branch_true T
Expand Down Expand Up @@ -38,7 +41,7 @@ end
---@param arg1 string | function
---@param arg2? string
function M.validate_list(name, list, arg1, arg2)
if not vim.tbl_islist(list) then
if not islist(list) then
error(("%s is not list."):format(name))
end

Expand Down Expand Up @@ -160,7 +163,7 @@ end
-- util.try_get_keys({foo = "bar", hoge = "fuga", teka = "pika"}, ["teka", "foo"])
-- -> ["pika", "bar"]
function M.try_get_keys(tbl, keylst)
if not vim.tbl_islist(keylst) then
if not islist(keylst) then
return nil, "the 2nd argument is not list."
end

Expand Down
Loading