From c059eece0cdd681b2dd212946e3d48544cc079bf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 17 Oct 2023 17:43:37 +0200 Subject: [PATCH] refactor: Handler.load => Handler.resolve --- lua/lazy/core/handler/init.lua | 4 ++-- tests/core/plugin_spec.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazy/core/handler/init.lua b/lua/lazy/core/handler/init.lua index ba45de5..b7ce3e5 100644 --- a/lua/lazy/core/handler/init.lua +++ b/lua/lazy/core/handler/init.lua @@ -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) @@ -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 diff --git a/tests/core/plugin_spec.lua b/tests/core/plugin_spec.lua index ee5b007..51f6e03 100644 --- a/tests/core/plugin_spec.lua +++ b/tests/core/plugin_spec.lua @@ -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") @@ -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)