-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Lazy completion loading for Zsh #475
Conversation
Please add some comments next to the conditional describing what zsh_eval_context is expected to be when evaluating a shell completion autoload script vs. a script sourced directly by an rc file or shell command. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #475 +/- ##
========================================
Coverage 81.17% 81.17%
========================================
Files 10 10
Lines 786 786
========================================
Hits 638 638
Misses 148 148 ☔ View full report in Codecov by Sentry. |
@kislyuk Added a comment |
Hmm, that is not a comment and it is not what I was looking for. |
9c561e2
to
faf8ee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry, committed the test code instead of the comment, fixed it now.
LGTM, thanks. |
Released in v3.2.3, please test |
Currently when you use the generated completion script in Zsh via autoloading, it doesn't provide completions on the first tab press. This is because when Zsh autoloads a completion script, it expects it to directly generate completions, this little trick allows it to be directly evaluated and used as an autoloaded script. P.S. I think if the shell function is named the same as the autoloaded script, Zsh will call it directly on subsequent calls, bypassing the rest of the script, e.g. the `if` code below. See https://zsh.sourceforge.io/Doc/Release/Functions.html#Autoloading-Functions See kislyuk/argcomplete#475
You can simply save the completion script into a directory in the
$fpath
and it will work, the Homebrew formula for pipx already does that, but it doesn't work without this changeFixes #473