Closed luckman212 closed 7 months ago
It looks likes your syntax highlighter doesn't scope the bracket in question as a string. That context is necessary for BH to work properly. This seems like a syntax issue, not a BH Issue. It's possible if it is scoped as a common scope that should be ignored generally, we could alter the rule, but I suspect it should be a string and is just a syntax bug.
Thanks @facelessuser
So the "problem" is with the Bash syntax highlighter native to ST? I don't know if this is changeable? If it is, I don't know how to do it.
If we only change 1 character, curly brace {
→ letter a
for example, there is no problem
if [[ ${res:0:1} != 'a' ]]; then
echo 1>&2 "error in response from API"
exit 1
fi
Turns out they are scoped, but not as a normal string. I couldn't tell because your syntax highlighter made them look all white as if they were not scoped.
So we have to update the single quote rule and double quote rule to look for the scope meta.string.regexp.shell
and then tell the curly, round, and square rule to ignore meta.string.regexp.shell
. Then it works:
Thanks - I don't have whatever plugin you seem to be using to show the scopes. And not sure how to edit the syntax rules either (never done it before). Do you suggest doing this? Or should I just leave this alone...
It can be done locally, but I'll be issuing an update to the rules, so you can wait until then.
@luckman212 fix has been released. Give package control time to see it though. It could take up to two hours.
@facelessuser Amazing, this is super helpful. Confirmed it's working.
Thanks for fixing on a Sunday 🚀
Description
BH seems to be incorrectly matching a curly bracket that is part of a Bash string equivalency test. Not sure if there's a workaround.
Here's a small example:
Screenshot:
Support Info