Skip to content

Commit

Permalink
fix(pkg): disable loading of lazy.lua files for now
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 22, 2023
1 parent 7346276 commit 5317037
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/lazy/core/packspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ local Util = require("lazy.util")

---@class PackSpec
---@field dependencies? table<string, string>
---@field custom?: {lazy?:LazyPluginSpec}
---@field lazy? LazyPluginSpec
local M = {}

M.lazy_file = "lazy.lua"
M.pkg_file = "pkg.json"
M.enable_lazy_file = false

---@alias LazyPkg {lazy?:(fun():LazySpec), pkg?:PackSpec}

Expand Down Expand Up @@ -74,15 +75,15 @@ function M.get(plugin)
return
end
M.specs[plugin.dir] = M.specs[plugin.dir] or convert(plugin, M.packspecs[plugin.dir])
return M.specs[plugin.dir]
return vim.deepcopy(M.specs[plugin.dir])
end

function M.update()
local ret = {}
for _, plugin in pairs(Config.plugins) do
local spec = {
pkg = M.pkg(plugin),
lazy = M.lazy_pkg(plugin),
lazy = M.enable_lazy_file and M.lazy_pkg(plugin) or nil,
}
if not vim.tbl_isempty(spec) then
ret[plugin.dir] = spec
Expand All @@ -91,6 +92,7 @@ function M.update()
local code = "return " .. Util.dump(ret)
Util.write_file(Config.options.packspec.path, code)
M.packspecs = nil
M.specs = {}
end

---@param plugin LazyPlugin
Expand Down

0 comments on commit 5317037

Please sign in to comment.