@@ -23,7 +23,7 @@ function M:_add(value)
23
23
group = self .group ,
24
24
once = true ,
25
25
pattern = pattern ,
26
- callback = function ()
26
+ callback = function (ev )
27
27
if not self .active [value ] then
28
28
return
29
29
end
@@ -32,7 +32,7 @@ function M:_add(value)
32
32
-- load the plugins
33
33
Loader .load (self .active [value ], { [self .type ] = value })
34
34
-- check if any plugin created an event handler for this event and fire the group
35
- self :trigger (event , pattern , groups )
35
+ self :trigger (event , pattern , groups , ev . data )
36
36
Util .track ()
37
37
end ,
38
38
})
61
61
--- @param event string | string[]
62
62
--- @param pattern ? string
63
63
--- @param groups table<string,true>
64
- function M :trigger (event , pattern , groups )
64
+ function M :trigger (event , pattern , groups , data )
65
65
local events = M .trigger_events [event ] or { event }
66
66
--- @cast events string[]
67
67
for _ , e in ipairs (events ) do
@@ -77,7 +77,7 @@ function M:trigger(event, pattern, groups)
77
77
end
78
78
Util .track ({ event = autocmd .group_name })
79
79
Util .try (function ()
80
- vim .api .nvim_exec_autocmds (autocmd .event , { group = autocmd .group , modeline = false })
80
+ vim .api .nvim_exec_autocmds (autocmd .event , { group = autocmd .group , modeline = false , data = data })
81
81
Util .track ()
82
82
end )
83
83
end
0 commit comments