[quote=“vitaLee”]Great update!!!
Havent checked the options in detail but played around with Ruby brackets marking.
[attachment=1]Screen shot 2012-10-23 at 19.58.50.png[/attachment]
after that updated the open pattern to
[pre=#212121] “open”: “^\s*\b(if|until|while|begin|class|module|def\s*[a-zA-Z_]+)\b”,[/pre]
[/quote]
Cool, I will update that.
[quote=“vitaLee”]
but then how do i define new pattern to match do-end block as in
[attachment=0]Screen shot 2012-10-23 at 20.08.28.png[/attachment]
if i define new bracket definition as simple as
[pre=#212121]{
“name”: “ruby”,
“open”: “\b(do)\b”,
“close”: “\b(end)\b”,
“icon”: “dot”,
“color”: “keyword”,
“style”: “underline”,
“scope_exclude”: “string”, “comment”],
“language_filter”: “whitelist”,
“language_list”: “Ruby”],
“enabled”: true
},[/pre]
if it’s placed before default definition then do-end blocks get matched but all other defined with open pattern above fail, and on the flip side if i define this after default definition then do-end blocks are not matched.
i guess it’s because both definitions share the same close pattern.[/quote]
Right now, it would have to be included in your original Ruby pattern. This is simply something I didn’t think about. They are combined in one regex (each bracket definition should only have one capturing group), that group id is used to identify what pair the brackets are from. Then I resolve all of the brackets until I find the matching pair.
There is kind of a way around it, but it would require a bracket plugin. I may try and in some additional support for such cases in the future, but I will post a way you can resolve this with a plugin as a stop gap solution.