Skip to content

Conversation

Farzat07
Copy link
Contributor

@Farzat07 Farzat07 commented Nov 8, 2022

This makes sure that the lines output to the PLUGIN_NAME.plugin.zsh file are as intented in the documentation:
https://wiki.zshell.dev/community/zsh_plugin_standard#zero-handling

I just had the feeling that the variable expansion in these two particular lines wasn't intentional.

Pull request template

Type of changes

  • CI
  • Bugfix
  • Feature
  • Generic maintenance tasks
  • Documentation content changes
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no URL changes)
  • Improving the performance of the project (not introducing new features)
  • Other (please describe):

Issue Number: N/A

What is the current behavior?

The following lines are created as a part of the file PLUGIN_NAME.plugin.zsh:

0=".zi-create"
0="MY_ZSH_HOME/.zi/plugins/_local---my-zsh-completions/.zi-create"

What is the new behavior?

The following lines are created instead:

0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
0="${${(M)0:#/*}:-$PWD/$0}"

Does this introduce a breaking change?

  • Yes
  • No

Other information

N/A

This makes sure that the lines output to the PLUGIN_NAME.plugin.zsh file
are as intented in the documentation:
https://wiki.zshell.dev/community/zsh_plugin_standard#zero-handling
@Farzat07 Farzat07 requested a review from a team as a code owner November 8, 2022 09:46
@github-actions github-actions bot added documentation 📝 Solely about the documentation of the project. enhancement ✨ Enhancement of the code, not introducing new features. labels Nov 8, 2022
@ss-o
Copy link
Member

ss-o commented Nov 11, 2022

Hi @Farzat07, well spotted, thank you for your contribution 🎯

@ss-o ss-o merged commit 17ec2f7 into z-shell:main Nov 11, 2022
@Farzat07 Farzat07 deleted the fix_zi-create branch November 12, 2022 10:09
@github-actions
Copy link

Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation 📝 Solely about the documentation of the project. enhancement ✨ Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants