mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat!: plugins are now autmatically loaded on require. module=
no longer needed!
This commit is contained in:
parent
0b6dec46e0
commit
575421b3fb
4 changed files with 84 additions and 52 deletions
|
@ -38,7 +38,7 @@ function M.try(fn, msg)
|
|||
if not info then
|
||||
break
|
||||
end
|
||||
if info.what == "Lua" and not info.source:find("lazy.nvim") then
|
||||
if info.what ~= "C" and not info.source:find("lazy.nvim") then
|
||||
local source = info.source:sub(2)
|
||||
if source:find(Config.root, 1, true) == 1 then
|
||||
source = source:sub(#Config.root + 1)
|
||||
|
@ -67,6 +67,20 @@ function M.try(fn, msg)
|
|||
return ok and result or nil
|
||||
end
|
||||
|
||||
function M.get_source()
|
||||
local f = 2
|
||||
while true do
|
||||
local info = debug.getinfo(f, "S")
|
||||
if not info then
|
||||
break
|
||||
end
|
||||
if info.what ~= "C" and not info.source:find("lazy.nvim", 1, true) then
|
||||
return info.source:sub(2)
|
||||
end
|
||||
f = f + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- Fast implementation to check if a table is a list
|
||||
---@param t table
|
||||
function M.is_list(t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue