Code Highlilghting for visual reference

I know I can collapse code, and mark the lines etc, but is there a way I can highlight a set of lines, and set it as
a particular color so it would be much easier to visually reference?

For example…

This way I can color code different sections of the logic, and reference them easily in the future.

FWIW, this is a great-- maybe even brilliant-- idea in principle, but in practice I’m not sure how to make it persistent across program instances. The information that that section should be differently colored needs to be stored somewhere, or else it will reset when the user closes the program. If it gets stored, where should the formatting information go?

It could be done like Matlab, where the editor can read commented directives and use them to achieve a similar aim. But if so, then presumably the code file will start accumulating arcane directives. This is fine for Matlab, because they control the whole ecosystem, but for more widespread formats I don’t know how to keep the code from crufting up. Especially because Komodo cannot mandate it’s own brand of formatting directives.

The formatting could be stored locally, but then there might be weird issues when the code is updated outside the editor. It makes sense that the formatting would be easy to handle if extra lines are added in between the beginning and the end of the formatted section, but what happens if a fellow programmer rearranges the file for better readability and the colored section jumps significantly?

I don’t want to rain on your idea, I really love it. But there are some practical details which need to be resolved so that users are left feeling that this has added functionality to their lives, and not frustration.

Thanks for the response and I totally understand.

I feel it’s really pragmatic if you make it ( for lack of a better term ) a dumb feature.

This doesn’t have to be a universal (built-in) option. Although if I’m writing an app I try to make
all things applicable, anywhere, and however the product is used. However; for this purpose what I’m
referring too is mainly a ‘notation’ type feature, and not a configuration that is expected to be maintained.

Since the highlighting is simply a visual reference point; it doesn’t have to be a smart feature.

Think of it as a simple ‘highlighting notation’ feature. If I want something more permanent I would most
likely comment the code with very identifiable code blocks which is what we all do anyway, but highlighting
would be so freakin helpful I think.

My expectation of a feature like this ( or plugin ), is that it is only relevant for the life of the session I am using. Once I close the app I don’t expect the notations (highlighting) to be maintained. I’ll just refer to the code comments for that.

The Highlighting is only to help my current in-document workflow. It’s not for the big picture, or to be used for any long term use. At most; I would hope for ‘maybe’ a right-click context menu that says something like…

“Highlight with Red,Green,Blue, Yellow, White, etc…”

The highlighting would only be good for the current session of course; soo… no need to create any long-term
architecture for this feature. It’s just a simple reference to help me write logic on the current document.

It doesn’t have to be language specific. It doesn’t have to be maintained for any long term use.

This would be extremely valuable to both novice and pro’s alike.

Hi guys, I knocked up a small macro that should allow you to add some basic text markings, persisting across sessions. Take it as a sample script which you can freely fork and adjust to your own needs:

http://komodoide.com/resources/macros/komodo--marktext/

(Github repo is linked in the widget on the right)

2 Likes

Awesome. Thanks :slight_smile: