mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat(plugin): allow plugin files only without a main plugin module. Fixes #53
This commit is contained in:
parent
f5734f512f
commit
44f80a7f5d
4 changed files with 23 additions and 16 deletions
|
@ -10,7 +10,6 @@ M.files = {}
|
|||
|
||||
---@type vim.loop.Timer
|
||||
M.timer = nil
|
||||
M.main = nil
|
||||
M.root = nil
|
||||
|
||||
function M.enable()
|
||||
|
@ -19,8 +18,7 @@ function M.enable()
|
|||
end
|
||||
if type(Config.spec) == "string" then
|
||||
M.timer = vim.loop.new_timer()
|
||||
M.root = vim.fn.stdpath("config") .. "/lua/" .. Config.spec:gsub("%.", "/")
|
||||
M.main = vim.loop.fs_stat(M.root .. ".lua") and (M.root .. ".lua") or (M.root .. "/init.lua")
|
||||
M.root = vim.fn.stdpath("config") .. "/lua/"
|
||||
M.check(true)
|
||||
M.timer:start(2000, 2000, M.check)
|
||||
end
|
||||
|
@ -56,8 +54,7 @@ function M.check(start)
|
|||
end
|
||||
end
|
||||
|
||||
check(nil, M.main)
|
||||
Util.lsmod(M.root, check)
|
||||
Util.lsmod(Config.spec --[[@as string]], M.root, check)
|
||||
|
||||
for file in pairs(M.files) do
|
||||
if not checked[file] then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue