Skip to content

Commit cdfa788

Browse files
committed
fix(loader): fixed event check in reload. Fixes #1124
1 parent f739865 commit cdfa788

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lua/lazy/core/loader.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ function M.reload(plugin)
259259
load = true
260260
end
261261

262-
for _, event in ipairs(plugin.event or {}) do
263-
if event == "VimEnter" or event == "UIEnter" or event:find("VeryLazy") then
262+
local events = plugin._.handlers and plugin._.handlers.event and plugin._.handlers.event or {}
263+
264+
for _, event in pairs(events) do
265+
if event.id:find("VimEnter") or event.id:find("UIEnter") or event.id:find("VeryLazy") then
264266
load = true
265267
break
266268
end

lua/lazy/types.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
---@field build? string|fun(self:LazyPlugin)|(string|fun(self:LazyPlugin))[]
3333
---@field opts? PluginOpts
3434

35-
---@class LazyPluginHandlers: {[string]: any}
35+
---@class LazyPluginHandlers
3636
---@field event? table<string,LazyEvent>
3737
---@field ft? table<string,LazyEvent>
3838
---@field keys? table<string,LazyKeys>

0 commit comments

Comments
 (0)