diff --git a/lua/legendary/data/keymap.lua b/lua/legendary/data/keymap.lua index f272b54..be534b4 100644 --- a/lua/legendary/data/keymap.lua +++ b/lua/legendary/data/keymap.lua @@ -109,7 +109,8 @@ end ---Bind the keymap in Neovim ---@return Keymap function Keymap:apply() - if vim.tbl_islist(self.mode_mappings) then + local islist = vim.islist or vim.tbl_islist + if islist(self.mode_mappings) then -- description-only keymap return self end @@ -133,7 +134,8 @@ function Keymap:frecency_id() end function Keymap:modes() - if vim.tbl_islist(self.mode_mappings) then + local islist = vim.islist or vim.tbl_islist + if islist(self.mode_mappings) then return self.mode_mappings end diff --git a/lua/legendary/init.lua b/lua/legendary/init.lua index d57cc6b..374de97 100644 --- a/lua/legendary/init.lua +++ b/lua/legendary/init.lua @@ -35,7 +35,8 @@ local function build_parser_func(parser) return end - if not vim.tbl_islist(items) then + local islist = vim.islist or vim.tbl_islist + if not islist(items) then error(string.format('Expected list, got ', type(items))) return end @@ -159,7 +160,8 @@ end ---Bind a *list of* autocmds and/or augroups ---@param aus table function M.autocmds(aus) - if not vim.tbl_islist(aus) then + local islist = vim.islist or vim.tbl_islist + if not islist(aus) then Log.error('Expected list, got %s.\n %s', type(aus), vim.inspect(aus)) return end