mirror of https://github.com/folke/lazy.nvim.git
fix(loader): don't deactivate when not loaded
This commit is contained in:
parent
e28555950f
commit
c83d2aeb27
|
@ -183,6 +183,10 @@ end
|
||||||
|
|
||||||
---@param plugin LazyPlugin
|
---@param plugin LazyPlugin
|
||||||
function M.deactivate(plugin)
|
function M.deactivate(plugin)
|
||||||
|
if not plugin._.loaded then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local main = M.get_main(plugin)
|
local main = M.get_main(plugin)
|
||||||
|
|
||||||
if main then
|
if main then
|
||||||
|
@ -195,7 +199,7 @@ function M.deactivate(plugin)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- execute deactivate when needed
|
-- execute deactivate when needed
|
||||||
if plugin._.loaded and plugin.deactivate then
|
if plugin.deactivate then
|
||||||
Util.try(function()
|
Util.try(function()
|
||||||
plugin.deactivate(plugin)
|
plugin.deactivate(plugin)
|
||||||
end, "Failed to deactivate plugin " .. plugin.name)
|
end, "Failed to deactivate plugin " .. plugin.name)
|
||||||
|
|
Loading…
Reference in New Issue