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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion highlighters/main/main-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ _zsh_highlight_main_highlighter_highlight_double_quote()
(( i += 2 ))
_zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,-1]
ret=$?
(( 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.

last_break=$(( start_pos + i ))
reply=(
$saved_reply
Expand Down