Skip to content

Commit

Permalink
fix(loader): fixed event check in reload. Fixes #1124
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 17, 2023
1 parent f739865 commit cdfa788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ function M.reload(plugin)
load = true
end

for _, event in ipairs(plugin.event or {}) do
if event == "VimEnter" or event == "UIEnter" or event:find("VeryLazy") then
local events = plugin._.handlers and plugin._.handlers.event and plugin._.handlers.event or {}

for _, event in pairs(events) do
if event.id:find("VimEnter") or event.id:find("UIEnter") or event.id:find("VeryLazy") then
load = true
break
end
Expand Down
2 changes: 1 addition & 1 deletion lua/lazy/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
---@field build? string|fun(self:LazyPlugin)|(string|fun(self:LazyPlugin))[]
---@field opts? PluginOpts

---@class LazyPluginHandlers: {[string]: any}
---@class LazyPluginHandlers
---@field event? table<string,LazyEvent>
---@field ft? table<string,LazyEvent>
---@field keys? table<string,LazyKeys>
Expand Down

0 comments on commit cdfa788

Please sign in to comment.