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