-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unable to highlight aliases that start with variables #938
Comments
`alias buckets='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma buckets'`.
⋮
```zsh
echo "echo run" > $HOME/run.sh
chmod +x ~/run.sh
alias run="\$HOME/run.sh"
run
```
z-sy-h has not implemented the full `man zshexpn | less -p "brain damage"` set of expansions. What it does do is highlight use of an alias according to how the expansion of the alias would be highlighted.
So, you should find that if you literally type `$HOME/run.sh` at the prompt, it's highlighted the same way "run" is.
Solving this in the general case is going to require some sort of "indeterminate whether this should be green or red" highlighting, due to side effects (e.g., $(foo), or $((++bar)), or ${baz} where baz is `special` and its getfn() has side effects). Highlighting the specific case of `$foo/bar` at command position should easy enough, though. In fact, I thought we'd already merged a PR for this... Perhaps it's still open? (It might not mention aliases.)
[Incidentally, "easy enough" does still mean it'd be good to check that that $foo is `scalar`, is not `special`, and either $foo has a value or $zsyh_user_options[unset] doesn't have the value that means attempting to expand an unset variable is an error.]
|
In the case of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get to this issue from bash-my-aws, which have this alias in it:
alias buckets='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma buckets'
.The
buckets
alias works, and the autocomplete work fine, but for some reason it highlights it as not found.There is superuser question about it.
Step to reproduce:
The text was updated successfully, but these errors were encountered: