Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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.

# for free to join this conversation on GitHub. Already have an account? # 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