Bookmarks-TOC

Script editor, GUI designer, debugger and tools for AutoHotkey
StefOnSteroids
Posts: 40
Joined: 08 Aug 2015, 10:22

Bookmarks-TOC

18 May 2018, 08:20

An idea for a feature most editors lack: permanent/portable bookmarks.
Basically it's nothing else but a search for all comment-lines that look like this:

Code: [Select all] [Download] GeSHi © Codebox Plus

;NOTE: YourBookmarkText

A sidebar (or floating window) displays all these lines (search results) but without the word "NOTE". You only get to see YourBookmarkText.

It yields a kind of outline or table-of-contents, and allows easy jumping to these lines, hence the term bookmark, but with an emphasis on "permanent" because these bookmarks (;NOTE comments) are contained in the file itself. Even years later you immediately see the whole structure of your ahk-file in the sidebar at one glance.

I find it very useful for inserting "chapter headings" into my code, then seeing the whole enchilada outlined in the sidebar, very much like the TOC-sidebar in a word processor or novel-writing software.

Some editors like RJTextEdit even offer hierarchical sub-headings, others like SynWrite only support one level. In any case, it's a nice feature to have, imo.
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Re: Bookmarks-TOC

24 May 2018, 18:12

This kind of feature tends to become obscure as few users will be aware of it, like the ".LOG" of Notepad. A similar feature that has been asked a couple of times is a sidebar with the names of all functions and labels, which is more likely to be implemented in the future.
StefOnSteroids
Posts: 40
Joined: 08 Aug 2015, 10:22

Re: Bookmarks-TOC

25 May 2018, 07:03

Alguimist wrote:This kind of feature tends to become obscure as few users will be aware of it

True. Which does not mean they wouldn't appreciate the benefits once they do become aware of it.
I couldn't do without it anymore, but no problem, I keep scripts open in another editor that does show "named bookmarks" - then I jump to those line numbers in AutoGUI.

Alguimist wrote:A similar feature that has been asked a couple of times is a sidebar with the names of all functions and labels, which is more likely to be implemented in the future.

Looking forward to it. If this gets implemented via RegEx, maybe you could allow a custom RegEx on top of it: User preses a button and sees the sidebar filled with entries from his own RegEx search: This would take care of my wish for named bookmarks and also of other outlandish ideas users may come up with. :mrgreen:
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Re: Bookmarks-TOC

25 May 2018, 15:05

StefOnSteroids wrote:Looking forward to it. If this gets implemented via RegEx, maybe you could allow a custom RegEx on top of it: User preses a button and sees the sidebar filled with entries from his own RegEx search: This would take care of my wish for named bookmarks and also of other outlandish ideas users may come up with. :mrgreen:

There's actually one thing you can already do: in the Find/Replace dialog, type ";NOTE" or "(?<=;NOTE: ).*" and press "Mark All". Every occurrence becomes a bookmark and you can jump from one to another with Ctrl+PgDn/PgUp.
StefOnSteroids
Posts: 40
Joined: 08 Aug 2015, 10:22

Re: Bookmarks-TOC

26 May 2018, 00:49

Alguimist wrote:in the Find/Replace dialog, type ";NOTE" or "(?<=;NOTE: ).*" and press "Mark All". Every occurrence becomes a bookmark and you can jump from one to another with Ctrl+PgDn/PgUp.

It does not give me an overview or TOC, but it's a neat little trick nevertheless. THANKS! :thumbup:

Is there a tweak to change theme colors? I find it hard to read my - now bookmarked - comment lines. Personally, I don't need to see #Win-directives and other keywords stand out in readable contrast - they're always the same words anyway. Wish I could discern comments in equally good, legible contrast, for easy reading of what goes on for what reason. Anything I can do about it?
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Re: Bookmarks-TOC

26 May 2018, 19:38

StefOnSteroids wrote:Is there a tweak to change theme colors?

Theme customization was not implemented yet, even though there is an alternative dark theme. In order to change the default colors for comments you need to modify two lines in Editor.ahk: search for "COMMENTLINE" and "COMMENTBLOCK".
StefOnSteroids
Posts: 40
Joined: 08 Aug 2015, 10:22

Re: Bookmarks-TOC

28 May 2018, 02:03

Alguimist wrote:to change the default colors for comments you need to modify two lines in Editor.ahk: search for "COMMENTLINE" and "COMMENTBLOCK".

That did the trick. Awesome. Many thanks. :D

Return to “AutoGUI”

Who is online

Users browsing this forum: No registered users and 3 guests