@vitaLee, try this: this will make all ruby keywords underlined, but do will be outlined.
Put this in your User folder for now as rubykeywords.py
[pre=#2D2D2D]def post_match(view, name, first, second, center, bfr, threshold):
bracket_name = “rubydo” if bfrfirst.begin:first.end] == “do” else name
return first, second, bracket_name[/pre]
Define “do” in the original ruby, and create a “rubydo” after that as seen below.
[pre=#2D2D2D] // Ruby conditional statements
{
“name”: “ruby”,
“open”: “^\s*\b(if|until|while|begin|class|module|do|def\s*[a-zA-Z_]+)\b”,
“close”: “\b(end)\b”,
“icon”: “dot”,
“color”: “keyword”,
“style”: “underline”,
“scope_exclude”: “string”, “comment”],
“plugin_library”: “User.rubykeywords”,
“language_filter”: “whitelist”,
“language_list”: “Ruby”],
“enabled”: true
},
{
“name”: “rubydo”,
“open”: “^\s*\b(do)\b”,
“close”: “\b(end)\b”,
“icon”: “dot”,
“color”: “keyword”,
“style”: “outline”,
“scope_exclude”: “string”, “comment”],
“language_filter”: “whitelist”,
“language_list”: “Ruby”],
“enabled”: true
},[/pre]
You can extend this concept to break out as many as you want. I do assume that if too many separate kinds of brackets are defined for one sytntax file, that you could theoretically hit a limit, but even if you split all of the ruby keywords into their own separate one, you probably wouldn’t hit it.
Hopefully in the future I can fix it so that BH will be smart enough to resolve these kinds of things without the need of a plugin.