Skip to content

Commit

Permalink
refactor: Handler.load => Handler.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 17, 2023
1 parent 03419f3 commit c059eec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lua/lazy/core/handler/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end
function M.enable(plugin)
if not plugin._.loaded then
if not plugin._.handlers then
M.load(plugin)
M.resolve(plugin)
end
for type in pairs(plugin._.handlers or {}) do
M.handlers[type]:add(plugin)
Expand Down Expand Up @@ -98,7 +98,7 @@ function M:_values(values, plugin)
end

---@param plugin LazyPlugin
function M.load(plugin)
function M.resolve(plugin)
local Plugin = require("lazy.core.plugin")
plugin._.handlers = {}
for type, handler in pairs(M.handlers) do
Expand Down
4 changes: 2 additions & 2 deletions tests/core/plugin_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe("plugin spec opt", function()
local spec = Plugin.Spec.new(test)
assert(#spec.notifs == 0)
assert(vim.tbl_count(spec.plugins) == 1)
Handler.load(spec.plugins.bar)
Handler.resolve(spec.plugins.bar)
vim.print(spec.plugins.bar._.handlers)
local events = vim.tbl_keys(spec.plugins.bar._.handlers.event or {})
assert(type(events) == "table")
Expand Down Expand Up @@ -307,7 +307,7 @@ describe("plugin spec opt", function()
local spec = Plugin.Spec.new(test)
assert(#spec.notifs == 0)
assert(vim.tbl_count(spec.plugins) == 1)
Handler.load(spec.plugins.bar)
Handler.resolve(spec.plugins.bar)
local events = spec.plugins.bar._.handlers.event
assert(type(events) == "table")
assert(vim.tbl_count(events) == 2)
Expand Down

0 comments on commit c059eec

Please sign in to comment.