Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid loading autoloaded file #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

syohex
Copy link

@syohex syohex commented Jul 21, 2021

In zsh file name convention, file name of which starts with '_' is
an autoloaded file. It should not be loaded manually.

This fixes zsh-users/zsh-completions#809

In zsh file name convention, file name of which starts with '_' is
an autoloaded file. It should not be loaded manually.
jcanseco added a commit to jcanseco/zgen that referenced this pull request Jul 24, 2021
jcanseco added a commit to jcanseco/.dotfiles that referenced this pull request Jul 24, 2021
This commit fixes an issue where the following error message would show
up whenever zsh starts up [1]:

    _arguments:comparguments:325: can only be called from completion
    function

This commit fixes the issue by replacing the zgen repo used by our
dotfiles with a fork that contains a community-contributed fix [2].

This is done since the official zgen repo appears to no longer be
actively maintained [3], meaning that the community-contributed PR is
unlikely to be accepted any time soon.

In the long-term, we should consider migrating to actively maintained
forks of zgen like zgenom [4] or a different zsh plugin manager.
However, given that zsh plugin managers have a tendency to go inactive,
it might be best to consider finding a way to remove our reliance on
plugin managers entirely and just clone the zsh plugins directly.

[1] zsh-users/zsh-completions#809
[2] tarjoilija/zgen#132
[3] tarjoilija/zgen#123
[4] tarjoilija/zgen#123 (comment)
@jandamm
Copy link

jandamm commented Jul 25, 2021

I've fixed this issue at zgenom.
Your solution prohibits the user to manually load a file which starts with _.
zgen load <plugin> path/to/_file.sh would not source this file.

jcanseco added a commit to jcanseco/zgen that referenced this pull request Jul 26, 2021
This reverts commit d942f39.

This commit was cherry-picked from github.com/tarjoilija/pull/132
as a way to fix github.com/zsh-users/zsh-completions/issues/809.

However, this commit seems to have problems [1], and a more correct
solution exists [2].

[1] tarjoilija#132 (comment)
[2] jandamm/zgenom#61
forivall pushed a commit to forivall/zgen that referenced this pull request Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_arguments:comparguments:325: can only be called from completion function
2 participants