docs(annexes): document @zi-unregister-annex - #913
Merged
Merged
Conversation
The overview documented @zi-register-annex with no counterpart, so an annex had no documented way to satisfy the Plugin Standard unload contract. Removing a handler while its registration survives leaves Zi dispatching to a function that no longer exists. The resulting 127 is folded into the return value and shifts the argument list, so later plug-ins stop loading for the rest of the session and the first one fails with `Error: No plugin or snippet ID given.' That consequence is called out in a warning admonition, because the symptom appears far from its cause. Covers the signature, that unregistering something never registered is a no-op, placement inside the annex's unload function, and the one documented limit: the ice-modifiers contributed at registration are not withdrawn, since registration does not record which annex contributed which entry. API added in z-shell/zi#503. Closes #912
Deploying zsh with
|
| Latest commit: |
2094250
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bccd965f.zsh.pages.dev |
| Branch Preview URL: | https://feature-912.zsh.pages.dev |
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.
Documents
@zi-unregister-annex, the counterpart to@zi-register-annexadded in z-shell/zi#503. One page, English source only.Why
The overview documented registration with no counterpart, so an annex had no documented way to satisfy the Zsh Plugin Standard unload contract.
Removing a handler while its registration survives leaves Zi dispatching to a function that no longer exists. A missing function returns
127,127 & 1is true, so Zi folds the error into its return value and shifts its argument list. Later plug-ins stop loading for the rest of the session, and the first one fails withError: No plugin or snippet ID given.That consequence gets a
:::warningbecause the symptom appears a long way from its cause: a plug-in that has nothing to do with the annex simply fails to load.z-shell/z-a-meta-pluginsworks around the missing API today by leaving an inert stub in place of its handler, and can stop once this is available.What is covered
*_plugin_unloadfunction:::info: ice-modifiers contributed at registration are not withdrawn, because registration does not record which annex contributed which entry, so a leftover ice name stays recognised but dispatches to nothingChecks
node scripts/validate-code-fences.mjspasses. Both new fences usezi, which the validator'sSUPPORTED_LANGUAGESincludes and which the surrounding page already uses.The new
[zsh-plugin-standard]link reference resolves to/community/zsh_plugin_standard#unload-function; that anchor exists atcommunity/03_zsh_plugin_standard.mdx:325.The heading carries an explicit id in the same
{/* #... */}form as the rest of the page. Admonitions and code fences balance.I did not run a full
pnpm build: this is a docs-only section addition and the worktree has nonode_modules. The fence validator, which is the check that covers what changed, runs standalone and passes.Closes #912