z-shell / zi

✨ A Swiss Army Knife for Zsh - Unix Shell
https://wiki.zshell.dev
MIT License
709 stars 41 forks source link

Prevent expansion in some lines in .zi-create func #238

Closed Farzat07 closed 1 year ago

Farzat07 commented 1 year ago

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

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?

Other information

N/A

ss-o commented 1 year ago

Hi @Farzat07, well spotted, thank you for your contribution :dart:

github-actions[bot] commented 1 year ago

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.