Home Download Buy Blog Forum Support

Dim out code

Dim out code

Postby belugacat on Tue Sep 10, 2013 10:31 pm


Would it be feasible to dim out code that's not in the current scope, as follows:


(a bonus would be to also dim out the minimap)

I'm willing to write the plugin myself, I just have no experience whatsoever doing so and would like to know if it's possible before diving in :)

Posts: 1
Joined: Tue Sep 10, 2013 10:21 pm

Re: Dim out code

Postby adzenith on Tue Sep 10, 2013 10:39 pm

Not (really) possible. The text color comes from the language file and can't be changed without changing the language definition. The only way to do it would be to recreate and reload the language file every time and use regular expressions to mark off all out-of-scope text.

This is one of those sadly gaping holes in the ST api. Someday...!
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Dim out code

Postby supergra on Tue Sep 10, 2013 10:47 pm

Darn, that would be beautiful.

Though you'd need some good heuristics to determine what scope depth to highlight. Probably don't want to look at all of a 500-line function, nor only a 2-line if-then statement. Perhaps some toggle keys to increase or decrease the depth at which it's highlighting.

Alas, apparently it is a moot point for now.
Posts: 8
Joined: Tue Sep 10, 2013 6:03 am

Re: Dim out code

Postby iamntz on Tue Sep 10, 2013 10:57 pm

Bracket highliter has this feature (sort of). Is called high visibility mode.
Posts: 908
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests