you might want to update open pattern to[pre=#212121]"open": "(^\s*\b(?:if|until|unless|while|begin|class|module|def\b\s*[a-zA-Z_]+)|do)\b"[/pre]to account for this side effect[attachment=0]Screen shot 2012-10-23 at 22.42.21.png[/attachment]

Great! Thanks for your help on this. I haven't coded in ruby so it is nice to have help nailing it down.

vitaLee:

Also i vote 1+ for styles extracted and reused across definitions.

That is the good thing about this being an alpha; in an alpha I can change everything and say "I told it you it was an alpha". Beta I don't have that much flexibility. I am thinking it would make more sense with separate style objects. I will have to see how much I have to change in the algorithm to make that happen. I will see if anyone else chimes in as well.

Still tinkering with the styles. Separating the styles doesn't really reduce the number of style stuff by much, it just puts it in a separate place. The regions are made up of the whole combination of icon, color, and highlight style, so they really need to be one package. So even if you use the same color and highlight style, having different icons still means having separate style objects. And I really don't think I am looking for an overly complicated styling system either. I will play with it in the next couple of days, and hopefully role something out. I think the separation is good, I just don't think its going to amount to great reduction of stuff in the config file.

That is how it goes though; you want something highly configurable, sometimes the downside is you have to configure that stuff every time.

It isn't perfect yet. Tomorrow-Night by default highlights some things I don't want it to in some languages, I have changed most of those cases though. Also, there is a number of personal scopes in there you can keep or remove. And one more thing, some things that you see mine highlight won't highlight on yours because I use some modified languages that insert some special scopes for my theme to trigger off of, but in general, it should work fine for you.

If the matching group consist in more than one char, like, let's say <?php ?> thing and one it's invalid, it should stop highlight when you focus it. Don't know if this make sense, but try to look at the movie (i only moved left/right with arrow keys):

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:

[code]"open": "(^if.+:$)","close": "(^endif;$)",[/code]

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!

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.

is it a default behaviour for Sublime to add icon in the gutter for each line of a multiline underlined (mouthful) region, or it's something you control?i found myself exploitinhg BH2 in attempt to match Obj-C @interface@implementation directives and noticed if i use style:underline for each line of the opening "bracket" there's an icon in gutter, while the same is not true for outline, solid (icon only on first line).

is it a default behaviour for Sublime to add icon in the gutter for each line of a multiline underlined (mouthful) region, or it's something you control?i found myself exploitinhg BH2 in attempt to match Obj-C @interface@implementation directives and noticed if i use style:underline for each line of the opening "bracket" there's an icon in gutter, while the same is not true for outline, solid (icon only on first line).

Underline is a trick. It isn't like a normal region. There is no underline style really. There is an option in Sublime that says if a region is size 0, you can render it as an underline. So, to simulate an underline region, I take region X, Y and break it up into a series of zero size regions. So really an underline (y-x) regions, not one. That is why multi-line will show multiple icons. Because each underlined character is its own region.

what i came up is this pattern:[code] "open": "^\s*(if|foreach|while).*:$", "close": "^\s*(endif|endforeach|endwhile;$)"[/code]

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?

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.