[quote=“iamntz”]Ok, so, as i said, me dumb
I’m trying to make ST to also highlight if/endif foreach/endforeach and so on in php. What i have now (after like 50 different combinations or so) is this:
open": "(^if|foreach|while.+:$)",
"close": "(^endif|endforeach|endwhile;$)",
But will not match correctly what i need (php have two ways of doing blocks; one is with if/endif and the other is with curly braces)
However, if i’ll do only this:
"open": "(^if.+:$)",
"close": "(^endif;$)",
works good…ish. Because will make things red (which is an error) when i focus inside of the condition:
While things are peachy when i’m inside of the block:
What do i do wrong?
Thanks![/quote]
You are doing nothing wrong. What you need is a bracket plugin that taps into the compare event. During that event, you would need to compare the values to help sort out which closing bracket goes with which opening bracket. Give me an hour or so and I will try and show you what I mean. You are diving into undocumented awesomeness.