feat: cleanup keys/cmd handlers when loading a plugin

This commit is contained in:
Folke Lemaitre 2022-12-03 23:15:50 +01:00
parent c98e722fa4
commit 3f517abfa4
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 154 additions and 99 deletions

View file

@ -1,5 +1,6 @@
local Util = require("lazy.core.util")
local Config = require("lazy.core.config")
local Handler = require("lazy.core.handler")
local M = {}
@ -27,7 +28,6 @@ function M.setup()
-- setup handlers
Util.track("handlers")
local Handler = require("lazy.core.handler")
Handler.setup()
Util.track()
@ -81,6 +81,7 @@ function M.load(plugins, reason)
table.insert(M.loading, plugin)
Util.track({ plugin = plugin.name, start = reason.start })
Handler.cleanup(plugin)
vim.opt.runtimepath:prepend(plugin.dir)
if not M.init_done then