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

Add a missing "$" on a variable usage #908

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CharlesGueunet
Copy link

Fixes #907

@CharlesGueunet
Copy link
Author

@danielshahaf please review

(( i += REPLY ))
(( i += $REPLY ))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Unfortunately, it's not a complete fix.

Arithmetic expressions are parsed for substitutions and then, in a second pass, evaluate identifiers into their values. Thus, the incumbent code is correct, and even idiomatic (consider foo=2+2; echo $((foo*2)) $(($foo*2))), and conversely, the patch would seem to merely paper over the issue.

I'm curious why it works, but we can discuss that back on the issue's ticket.

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.

_zsh_highlight_main_highlighter_highlight_double_quote:47: bad math expression
2 participants