Repository navigation
fix: main detection beside a compiled module, and the spec's main on the plugin in every hook - #57
Merged
Merged
Conversation
… beside a Lua one
…rigger functions
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two follow-ups to #55.
Fixes
.so/.dll) directly under a plugin'slua/counts as one of its modules, as in lazy.nvim, whether it is a regular file or a symlink. A plugin with one Lua module beside a compiled one no longer gets that Lua module asmain(fix: lazy keys in mode "!", reload, named update of a cond = false plugin, and main detection #55 introduced this); it gets the "setmainexplicitly" warning again. A plugin whose only module is compiled now gets it asmain.plugin.mainis the spec'smainfrom the start, as in lazy.nvim, socond, trigger functions,init,optsfunctions,buildanddeactivatesee it on first load and after:ZPack reload. Before fix: lazy keys in mode "!", reload, named update of a cond = false plugin, and main detection #55 a plugin with nooptsorconfiggot it only after a reload; since fix: lazy keys in mode "!", reload, named update of a cond = false plugin, and main detection #55 it never did. Amainoffalsestill leaves the module to detection.A detected
mainis still set before the firstconfigruns.resolve_mainno longer reads the spec'smainitself: registration is the only writer of an explicitmain, so itsspecparameter is gone.Known difference from lazy.nvim
Only a Lua module is matched against the plugin's name: foo.nvim with
lua/foo.sobeside another module gets nomain, where lazy.nvim takesfoo.:h zpack-Spec.mainsays so.Docs
:h zpack-Spec.mainsays how a compiled module counts. Theplugin.mainreference lines indoc/zpack.txt,docs/spec.mdandtypes.luasay the spec'smainis there in every hook.Testing
zb checkagainst the base: no lazy flips, structural or opts differences; no perf row flagged.