mirror of
https://github.com/zoriya/lz.n.git
synced 2025-12-23 07:05:11 +00:00
32 lines
558 B
Lua
32 lines
558 B
Lua
local event = require("lz.n.handler.event")
|
|
|
|
---@class LzFtHandler: LzHandler
|
|
---@field parse fun(spec: LzEventSpec): LzEvent
|
|
|
|
---@type LzFtHandler
|
|
local M = {
|
|
pending = {},
|
|
type = "ft",
|
|
---@param value string
|
|
---@return LzEvent
|
|
parse = function(value)
|
|
return {
|
|
id = value,
|
|
event = "FileType",
|
|
pattern = value,
|
|
}
|
|
end,
|
|
}
|
|
|
|
---@param plugin LzPlugin
|
|
function M.add(plugin)
|
|
event.add(plugin)
|
|
end
|
|
|
|
---@param plugin LzPlugin
|
|
function M.del(plugin)
|
|
event.del(plugin)
|
|
end
|
|
|
|
return M
|