mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(event): move all ft logic to the event handler
This commit is contained in:
parent
f2132946c7
commit
8871602e54
2 changed files with 74 additions and 57 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue