mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
refactor: simplified handler code
This commit is contained in:
parent
17d1653b4a
commit
ecf03a6892
7 changed files with 58 additions and 91 deletions
|
@ -6,15 +6,16 @@ local M = {}
|
|||
M.extends = Event
|
||||
|
||||
---@param value string
|
||||
function M:_value(value)
|
||||
function M:_event(value)
|
||||
return "FileType " .. value
|
||||
end
|
||||
|
||||
---@param plugin LazyPlugin
|
||||
---@param value string
|
||||
function M:_add(plugin, value)
|
||||
Loader.ftdetect(plugin.dir)
|
||||
Event._add(self, plugin, value)
|
||||
function M:add(plugin)
|
||||
self.super.add(self, plugin)
|
||||
if plugin.ft then
|
||||
Loader.ftdetect(plugin.dir)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue