mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(ft): only trigger filetypepluing and filetypeindent for ft handler. Fixes #228
This commit is contained in:
parent
db043da829
commit
7de662d037
2 changed files with 20 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
local Event = require("lazy.core.handler.event")
|
||||
local Util = require("lazy.core.util")
|
||||
local Loader = require("lazy.core.loader")
|
||||
|
||||
---@class LazyFiletypeHandler:LazyEventHandler
|
||||
|
@ -18,4 +19,19 @@ function M:add(plugin)
|
|||
end
|
||||
end
|
||||
|
||||
---@param pattern? string
|
||||
function M:trigger(_, pattern, _)
|
||||
for _, group in ipairs({ "filetypeplugin", "filetypeindent" }) do
|
||||
Util.try(function()
|
||||
Util.info({
|
||||
"# Firing Events",
|
||||
" - **group:** `" .. group .. "`",
|
||||
" - **event:** FileType",
|
||||
pattern and (" - **pattern:** " .. pattern),
|
||||
})
|
||||
vim.api.nvim_exec_autocmds("FileType", { group = group, modeline = false, pattern = pattern })
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue