[quote=“iamntz”]Thanks! Works… partially
because it also match if(){} expressions (and it shouldn’t)
what i came up is this pattern:
"open": "^\\s*(if|foreach|while).*:$",
"close": "^\\s*(endif|endforeach|endwhile;$)"
Thing is… while in regexbuddy works just fine, in editor it doesn’t. Most likely i do some escaping wrong. Any idea which is that? Thanks!
Btw, i noticed that if there is an error somewhere in the config file, the plugin stop to works until i restart ST. It’s a bug, a feature or a bit of both? [/quote]
I need to think about this. Basically the open regex and close regex occur on separate passes. So for “if():” the open regex gobbles up “(” and “)”, but the close pass finds “)”. So when the brackets get resolved, it can’t pair up “)”, because the open got gobbled up in “if():”.
Basically, the this is a case where the open regex intersects with the close. I need time to think how to resolve this issue.
As for the plugin stopping working on bad settings file? I will have to think about how to gracefully handle that as well.