feat: GH-45 Add events when enabling/disabling the plugin (#46)

This commit is contained in:
Toni Müller
2024-02-27 08:27:10 +01:00
committed by GitHub
parent e98cafef75
commit b23f238128
3 changed files with 15 additions and 5 deletions
+7 -3
View File
@@ -20,9 +20,13 @@ M.create_augroup = function(opts)
end
--- @param pattern string
--- @param saved_buffer number
M.exec_autocmd = function(pattern, saved_buffer)
api.nvim_exec_autocmds("User", { pattern = pattern, data = { saved_buffer = saved_buffer } })
--- @param data? table
M.exec_autocmd = function(pattern, data)
local opts = { pattern = pattern }
if data ~= nil then
opts.data = data
end
api.nvim_exec_autocmds("User", opts)
end
--- @param trigger_events TriggerEvent[]?