luochen1990 / rainbow

Rainbow Parentheses Improved, shorter code, no level limit, smooth and fast, powerful configuration.
Apache License 2.0
1.78k stars 95 forks source link

C++ template syntax support #181

Open PlasmaHH opened 2 years ago

PlasmaHH commented 2 years ago

Not sure if this is really a feature request, or more a request of how to configure things with proper syntax matching...

In C++ nested templates can get a bit ugly to read like a<b<c,e,>,g,> and so on... Therefore using rainbow parens for this can be useful... however there is the tricky part that < and > are part of comparison operations, and thus are for one, not always balanced, and then also in places where you don't want this to happen.

As this plugin is kind of a syntax highlight configuration generator, I wonder if it would be possible to restrict to certain syntactic constructs, or at least "reset" the balancing search if e.g. encountering a closing ) of an if( a > b) statement, or a final ; of a vector> v; delcaration or the : and { of a template struct foo : bar { }; definition...

( alternatively what would be already very helpful I guess is toggling the inclusion of < and > for a short amount of time when you really need the better readability )