Skip to content

Commit

Permalink
feat: simply re-issue the event for event cond load plugins (#29)
Browse files Browse the repository at this point in the history
Co-authored-by: eph <[email protected]>
  • Loading branch information
epheien and eph authored Jul 17, 2024
1 parent 97c9d82 commit b02d02c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lua/pckr/loader/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
--- @return fun(_: fun())
return function(events, pattern)
return function(loader)
local done = false
vim.api.nvim_create_autocmd(events, {
pattern = pattern,
once = true,
desc = 'pckr.nvim lazy load',
callback = function()
callback = function(ev)
if done then
return true
end
-- HACK: work-around for https://github.com/neovim/neovim/issues/25526
done = true
loader()
-- TODO(lewis6991): should we re-issue the event? (#1163)
-- vim.api.nvim_exec_autocmds(event, { modeline = false })
vim.api.nvim_exec_autocmds(ev.event, {
buffer = ev.buf,
group = ev.group,
modeline = false,
data = ev.data,
})
end,
})
end
Expand Down

0 comments on commit b02d02c

Please sign in to comment.