mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: lazy caching now works with functions that have upvalues
This commit is contained in:
parent
48199f8031
commit
fe33e4e3dd
9 changed files with 161 additions and 187 deletions
|
@ -27,6 +27,20 @@ function M.track(name, time)
|
|||
end
|
||||
end
|
||||
|
||||
-- Fast implementation to check if a table is a list
|
||||
---@param t table
|
||||
function M.is_list(t)
|
||||
local i = 0
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
for _ in pairs(t) do
|
||||
i = i + 1
|
||||
if t[i] == nil then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function M.very_lazy()
|
||||
local function _load()
|
||||
vim.defer_fn(function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue