fix(event): move all ft logic to the event handler

This commit is contained in:
Folke Lemaitre 2023-10-07 11:15:12 +02:00
parent f2132946c7
commit 8871602e54
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 74 additions and 57 deletions

View file

@ -1,7 +1,5 @@
local Event = require("lazy.core.handler.event")
local Util = require("lazy.core.util")
local Loader = require("lazy.core.loader")
local Config = require("lazy.core.config")
---@class LazyFiletypeHandler:LazyEventHandler
local M = {}
@ -20,21 +18,4 @@ function M:add(plugin)
end
end
---@param opts LazyEventOpts
function M:_trigger(opts)
Util.try(function()
if Config.options.debug then
Util.info({
"# Firing Events",
" - **event:** FileType",
opts.pattern and (" - **pattern:** " .. opts.pattern),
opts.buf and (" - **buf:** " .. opts.buf),
})
end
Util.track({ event = "FileType" })
vim.api.nvim_exec_autocmds("FileType", { modeline = false, buffer = opts.buf })
Util.track()
end)
end
return M