Would it make more sense to separate styles from bracket definitions?
For instance, you have some definition pointing to a style object (in this case a style object called “ruby”):
[pre=#2D2D2D] // Ruby conditional statements
{
“name”: “ruby”,
“open”: “^\s*\b(if|unless|until|while|begin|class|module|do|def\s*[a-zA-Z_]+)\b”,
“close”: “\b(end)\b”,
“style”: “ruby”,
“scope_exclude”: “string”, “comment”],
“plugin_library”: “User.rubykeywords”,
“language_filter”: “whitelist”,
“language_list”: “Ruby”],
“enabled”: true
},[/pre]
And then you have style objects:
[pre=#2D2D2D] “styles”: {
“ruby”: {
“icon”: “dot”,
“style”: “underline”,
“color”: “brackethighlighter.ruby”
},
“rubydo”: {
“icon”: “dot”,
“style”: “underline”,
“color”: “brackethighlighter.rubydo”
}
// More styles here…
}[/pre]
That way you could have one definition and then define many other styles. A post match plugin could simply throw back a style, and you wouldn’t have dummy regex clogging up the system.
What do you guys think?