Sublime Forum

Dim out code

#1

Hi!

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 :smile:

Thanks!

0 Likes

Highlight current scope?
#2

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…!

0 Likes

#3

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.

0 Likes

#4

Bracket highliter has this feature (sort of). Is called high visibility mode.

0 Likes

#5

Hi all,

I was looking for functionality in ST3 that comes close to what has been asked in this thread, so I’ll post here if noone minds. I use ST3 for writing texts in Markdown. Not its primary use, I know, but it works like a charm, except for one little thing. In an editor I used previously (Writemonkey), there was a focus feature. Basically, you could select a piece of text, press F6 and the rest of the text just disappeared. It was not dimmed out, rather the selected paragraph was presented to the user in a kind of temporary space, in order to zoom in on this particular text portion and hide all other clutter from view. When done editing the selected paragraph, you’d press F6 again and all your edits would be incorporated in the original text. It was a feature highly useful for writing. I was wondering if there exists a plugin for ST3 to do something like that, or if it is possible to create such a plugin at all.

Thank you for your response.

Kind regards,
Maxim

0 Likes

#6

Try the FeaturePresentation plugin:

sublimetext.com/forum/viewtopic.php?f=5&t=15661

0 Likes

#7

[quote=“soapybirds”]Try the FeaturePresentation plugin:

sublimetext.com/forum/viewtopic.php?f=5&t=15661[/quote]

Thanks a lot mate, this is exactly what I was looking for.

0 Likes