We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e285559 commit c83d2aeCopy full SHA for c83d2ae
lua/lazy/core/loader.lua
@@ -183,6 +183,10 @@ end
183
184
---@param plugin LazyPlugin
185
function M.deactivate(plugin)
186
+ if not plugin._.loaded then
187
+ return
188
+ end
189
+
190
local main = M.get_main(plugin)
191
192
if main then
@@ -195,7 +199,7 @@ function M.deactivate(plugin)
195
199
end
196
200
197
201
-- execute deactivate when needed
198
- if plugin._.loaded and plugin.deactivate then
202
+ if plugin.deactivate then
203
Util.try(function()
204
plugin.deactivate(plugin)
205
end, "Failed to deactivate plugin " .. plugin.name)
0 commit comments