Repository navigation
[audit] Fix fff.nvim PackChanged listener — use User autocmd pattern - #133
stanfish06 wants to merge 1 commit into
Conversation
vim.pack fires a User event with pattern PackChanged, not a first-class PackChanged event. The old listener never fired, so fff.nvim's binary was never downloaded after install/update. Fixes #117
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dad9f7268
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| vim.api.nvim_create_autocmd("User", { | ||
| pattern = "PackChanged", |
There was a problem hiding this comment.
Restore the PackChanged event for vim.pack hooks
When vim.pack installs or updates fff.nvim (for example through SyncPkgs), this autocmd now listens for the User event instead of the actual PackChanged event, so the callback will not run and the fff binary still will not be downloaded. I checked the current Neovim pack/autocmd docs: PackChanged and PackChangedPre are first-class autocmd events, and the documented hook example uses vim.api.nvim_create_autocmd('PackChanged', ...) with this same ev.data shape.
Useful? React with 👍 / 👎.
What
vim.packfires aUserevent with patternPackChanged, not a first-classPackChangedevent. The autocmd inlua/config/plugin_config.luawas listening for"PackChanged"as the event name — which is a non-existent event and never fires. As a result,fff.nvim's binary was never downloaded afterSyncPkgsinstalled or updated the plugin.Where
lua/config/plugin_config.lua— thefffsection, around line 150.Why it matters
Without this fix,
require("fff.download").download_or_build_binary()is never called automatically. The user would need to manually invoke the download after everySyncPkgsrun.Change
Fixes #117.
Generated by Claude Code