Skip to content

Commit

Permalink
fix: avoid calling vim.fn.has inside fast event (#1705)
Browse files Browse the repository at this point in the history
When this module is lazily required inside functional/init.lua we may be inside a fast event, causing the module to fail
to load due to the top-level call to vim.fn.has.
  • Loading branch information
williamboman authored May 12, 2024
1 parent e91ff44 commit 1b3d604
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lua/mason-core/functional/type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ _.is = fun.curryN(function(typ, value)
return type(value) == typ
end, 2)

---@param value any
---@return boolean
_.is_list = vim.fn.has "nvim-0.10" and vim.islist or vim.tbl_islist
_.is_list = vim.islist or vim.tbl_islist

return _

0 comments on commit 1b3d604

Please sign in to comment.