2022-12-05 21:45:50 +08:00
|
|
|
local Event = require("lazy.core.handler.event")
|
|
|
|
local Loader = require("lazy.core.loader")
|
|
|
|
|
|
|
|
---@class LazyFiletypeHandler:LazyEventHandler
|
|
|
|
local M = {}
|
|
|
|
M.extends = Event
|
|
|
|
|
|
|
|
---@param value string
|
2022-12-16 16:13:08 +08:00
|
|
|
function M:_event(value)
|
2022-12-05 21:45:50 +08:00
|
|
|
return "FileType " .. value
|
|
|
|
end
|
|
|
|
|
|
|
|
---@param plugin LazyPlugin
|
2022-12-16 16:13:08 +08:00
|
|
|
function M:add(plugin)
|
|
|
|
self.super.add(self, plugin)
|
|
|
|
if plugin.ft then
|
|
|
|
Loader.ftdetect(plugin.dir)
|
|
|
|
end
|
2022-12-05 21:45:50 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|