Skip to content

Commit

Permalink
fix: only show fired ft events in debug obvioulsy. Fixes #232
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 29, 2022
1 parent a2eac68 commit c7c1295
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lua/lazy/core/handler/ft.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local Event = require("lazy.core.handler.event")
local Util = require("lazy.core.util")
local Loader = require("lazy.core.loader")
local Config = require("lazy.core.config")

---@class LazyFiletypeHandler:LazyEventHandler
local M = {}
Expand All @@ -23,12 +24,14 @@ end
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),
})
if Config.options.debug then
Util.info({
"# Firing Events",
" - **group:** `" .. group .. "`",
" - **event:** FileType",
pattern and (" - **pattern:** " .. pattern),
})
end
vim.api.nvim_exec_autocmds("FileType", { group = group, modeline = false, pattern = pattern })
end)
end
Expand Down

0 comments on commit c7c1295

Please sign in to comment.