refactor: moved handler to separate modules

This commit is contained in:
Folke Lemaitre 2022-12-05 14:45:50 +01:00
parent 1ae4e0ce9a
commit b8d8648d28
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
7 changed files with 320 additions and 228 deletions

View file

@ -0,0 +1,20 @@
local Event = require("lazy.core.handler.event")
local Loader = require("lazy.core.loader")
---@class LazyFiletypeHandler:LazyEventHandler
local M = {}
M.extends = Event
---@param value string
function M:_value(value)
return "FileType " .. value
end
---@param plugin LazyPlugin
---@param value string
function M:_add(plugin, value)
Loader.ftdetect(plugin)
Event._add(self, plugin, value)
end
return M