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

Handle compdef file locations: don't source add to $fpath #110

Closed

Conversation

blueyed
Copy link

@blueyed blueyed commented Feb 7, 2015

This allows to use completions from somewhere, e.g.

antigen bundle blueyed/hub --loc=etc/_hub --branch=improve-zsh-completion

Without this patch, an error is thrown:

% antigen bundle blueyed/hub --loc=etc/hub.zsh_completion --branch=improve-zsh-completion
_arguments:comparguments:312: can only be called from completion function

This then still needs a call to compinit, but that's meant to happen through antigen apply?!

This allows to use completions from somewhere, e.g.

    antigen bundle blueyed/hub --loc=etc/_hub --branch=improve-zsh-completion
@desyncr
Copy link
Member

desyncr commented Feb 13, 2016

Thank you for using and trying to improve Antigen.

As I understand zsh follows a convention for loading autocompletions, which is prefixing your autocompletion definitions with an underscore. This is also advised in the installation instructions for hub.

Given the use case is too specific we'd rather not add more complexity to Antigen.

@desyncr desyncr closed this Feb 13, 2016
@blueyed
Copy link
Author

blueyed commented Feb 14, 2016

@desyncr
Hmm, the file itself starts with an underscore?!
(https://github.com/blueyed/hub/blob/improve-zsh-completion/etc/_hub)

Do you mean the code should not look for #compdef, but for if the filename starts with an underscore?!

In my opinion it's more reliable to check for #compdef.

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.

None yet

2 participants