Repository navigation
Fix broken Zinit completion links after plugin provisioning - #392
Merged
Merged
Conversation
Plugins add their own checkout to fpath, so retargeted links into the final checkout were redundant and would break again whenever a pin update drops an upstream completion file. Remove dangling links into former staging directories instead, matched by directory name because Zinit records physical paths, and relink only _zinit to its installed file. Cleanup failures warn rather than stopping tools synchronization. The replaced path-mapping tests failed on macOS, where the temporary directory is reached through the /var symlink.
Match only links whose target lies inside a `.selfishell-zinit.<digits>` staging directory, not any path containing that text, and skip a completions directory that the user replaced with a link.
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.
Zinit creates completion links and rebuilds its completion dump even when provisioning plugins with
cloneonly. Selfishell v1.4.0 through v1.6.9 prepared checkouts in a temporary directory, so those links pointed at deleted staging paths after activation and caused intermittentcompiniterrors during rescans; the provisioning shell also deleted and rebuilt~/.zcompdump.Keep Zinit's completion directory and dump inside the private staging directory. During install and tools synchronization, remove dangling completion links whose target lies inside a former
.selfishell-zinit.<digits>staging directory (matched by directory name, since Zinit records physical paths) and relink only_zinitto Zinit's installed file. Plugins add their own checkout tofpath, so retargeting the plugin links would only recreate the problem when a pin update drops an upstream completion file. User files, live or unrelated links, disabled completions, a completions directory replaced by a link, and dry-run behavior are preserved; a cleanup failure warns instead of stopping synchronization.Validation:
bash scripts/check.sh: syntax, ShellCheck, formatting, Go vet, cross-builds, and all tests pass exceptTestNeovimDAPConfiguration, which fails identically onmainin the local environment._zinitrelink), the private completion directory, or the cleanup call fails a test.~/.zcompdumpand a dangling_zinitlink, and creates neither after this change.