lazy.nvim/lua/lazy/core/handler/ft.lua

25 lines
431 B
Lua
Raw Normal View History

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
end
function M:parse(value)
return {
id = value,
event = "FileType",
pattern = value,
}
end
return M