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

22 lines
409 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 value string
2022-12-16 16:13:08 +08:00
function M:_event(value)
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
end
return M