Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Active GoTo v4


  • Please log in to reply
85 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Active GoTo


v4 Changes:
- List Auto-Updates if there is a change in the sections (or their positions) in the script.
- The auto-update changes the order of the list ONLY if there is a change in the sections in the script,
and not if the change is only in their positions
- Support for hotstrings added
- Support for same line comments on section line added/improved
- If there are no sections in a file (eg. a new script), the ActiveGoTo window doesn't pop up.
- The hotkey Win+Tab toggles the gui hide/show. (Thanks toralf)
- The GUI only shows up when its hotkey is pressed, and not automatically (Thanks toralf)
- All Hotkeys context sensitive (Thanks toralf)
- The refresh hotkey (F5) is gone
- Removed support for .au3 scripts (Don't even know why I added that in the first place!)

v3 Changes:
- Auto update of list based on the currently open file in editor.
- Pressing F5 will refresh the list
- Check if the file open in editor is a script or not

v2 Changes:
- The ActiveGoto GUI gets hidden when neither it or Editor window are active (Thanks MsgBox)
- Support for OTB added (Thanks toralf)
- The alphabetical sort of function list is now optional (Thanks toralf)
- Hotkeys are now easily configurable (Thanks toralf)
- Some code optimizations


When you're working on a big script (say having 400-500 or maybe a couple of thousand lines) then what do you hate most? If you're like me then you hate scrolling from one part of the script to another the most... to counter that I'd made the bookmark script which remembered line contents so the bookmarks always worked (here). Though the advantage it had was that only the sections i wanted were bookmarked, the problem problem was that i still had to create those bookmarks. i didn't like that much either.

So that brings us to this script...

You run this script (preferably by a hotkey) and whatever the current script in your fav editor is, its instantly scanned and All Sections (including hotkey sections) and All Functions are presented as a sorted list of searchable bookmarks!!.. just select the section and press enter.(if you've used my 320MPH script then you'll find yourself at home).

A handy feature is Win+Left key to travel directly between last two used sections without using the ActiveGoto GUI.

Another very helpful feature is that when the script starts it presents a sorted list of sections, but as you keep using it, the recently traversed sections are moved to the top of the list, to make them easily accessible the next time.


Keyboard Help:

Win + Tab : Show Active Goto Window
Win + Left : Goto last browsed control
Esc : Hide Active Goto Window
Up/Down : Browse section list


Its set for PSPad but you can change it to whatever editor you like, it has just 2 reqmts:
- Editor must have a Goto Line cmd
- Editor window's title shows file path

Except Notepad probably every editor has those!

I've been using this for a while and it now is a necessity for me while scripting. (imagine that the current SGUI has about 100 sections!)

Posted Image
(screenshot from Rubberduck's script)

DOWNLOAD

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


MsgBox
  • Guests
  • Last active:
  • Joined: --
Hello Rajat

WHAT! Three days, 77 views and nobody has left a comment for this brilliant script! Disgraceful, thats what I say. :)

Thanks Rajat.

Navigation in PSPad is so much easier now.

I made a small change (to suit my personal preference!), and that is to hide the gui when PSPad is not active. If you don't mine, I will post it here.
EWCheck:
	IfWinNotExist, ahk_id %EWID%,, ExitApp
	; Hide if editor is not active.
	IfWinNotActive ahk_id %MWID%
	{
      IfWinNotActive ahk_id %EWID%
         DllCall( "AnimateWindow", "Int", MWID, "Int", 300, "Int", 0x00050002 )
   }
Return

When you're working on a big script (say having 400-500 or maybe a couple of thousand lines) then what do you hate most? If you're like me then you hate scrolling from one part of the script to another the most...

On ANY script large OR small that requires you to scroll, this is useful! (IMHO)

(screenshot from Rubberduck's script)

Do you mean a script that create's screen shots? If so, I can't find it! :(

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Hi Rajat,

I missed your post, until MagBox revived it. Thank you to you both.

I have already two requests:
1) I'm a fan of OTB, could you extend the script for these?
2) I like to order my labels/subroutines. So it would help me to have the labels in the GUI in the order they are in the file. To be able to switch between the alphabetic and ordered list, I would like to have ListView Control. But I guess in that case the "recently traversed sections are moved to the top of the list" will not work anymore.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Playing with it I realized more requests, please don't be offended, I just write them down for you to consider them.

1) My windows is german, so PSPads GoTo window is called "Gehe zu..." Maybe you could make it set that depending on the "A_Language"?

2) My notebook doesn't have a win key, could you change the script to easily modify the hotkeys? I used Ctrl instead of Win
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Hardeep
  • Members
  • 87 posts
  • Last active: Sep 12 2007 06:40 PM
  • Joined: 02 Jul 2006
Hi Rajat,

I have been using EditPlus for the same reason. It already has this feature built-in....but when working with other editors your script is really helpful.

Nice effort...Thanks :D

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've updated the script with these changes:
- The ActiveGoto GUI gets hidden when neither it or Editor window are active (Thanks MsgBox)
- Support for OTB added (Thanks toralf)
- The alphabetical sort of function list is now optional (Thanks toralf)
- Hotkeys are now easily configurable (Thanks toralf)
- Some code optimizations


hi MsgBox,
thanks for your kind words and review. I've updated the code with your change.

toralf,
I've done all the changes you requested except the language change, as that'll still add support for only PSPad, while for anyone who doesn't use the default english PSPad installation, he has only a li'l change to doin the config section at script's top only once (whether for another language or for another editor).

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
When I work on my code a lot and the line numbers change, the label names change, how can I refresh the list?
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Do you mean a script that create's screen shots? If so, I can't find it! :(

no, i just meant that the script whose sections ActiveGoto is showing in the screenshot is made by Rubberduck (i had it open at that time and i grabbed a screenshot from there)

by the way, when i made it initially, it had support for au3 scripts' sections as well... i've not re-checked it lately, though it probably still does support them.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Have you updated the code or link? The code I get from the first post looks the same as before.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Thanks for pointing that out. I used PSPad's ftp to update the file directly, but I must've messed up somewhere... i hope its fine now.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

When I work on my code a lot and the line numbers change, the label names change, how can I refresh the list?

yeah that's true... currently re-loading ActiveGoto is the only way. i guess i should make it so that when a section is selected to be opened, it should re-scan the whole file to find its new position... might make it a little slower but would be accurate... what do you think?

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
I guess it could be done automatically, e.g. when Ctrl+s is pressed, it can be scaned again, or if the title is missing a "*" (e.g. the user has pressed the save button or run the script which auto-saves). But Maybe a reload button will make it as well.

At the same time it could be monitored, if the file (window title) changes. I normally have multiple files open, so when I switch between files, I would like to see the list of sections for that file.

It also came to my mind, that your script will not recognize PSPad, when there is no file open. Then the title is "PSPad", but I guess that is rare.

Your script reads the whole file and "loop,parse" through the var. Is that faster then "loop,read" through the file? Since you want to have this operation fast, I guess this loop should be speed optinized as much as possible. E.g. make the file type decision outside of that loop. etc.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
What is the reason for
CurrLine = %A_LoopField%

	Check = %CurrLine%

	Check = %Check%

If you want to trim spaces away, wouldn't one of these lines have been enough.?!?
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
i see some nice ideas in your post toralf, thanks... let me see what i can do tonight.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
And I guess the hotkeys can be simplified to
#IfWinActive, ahk_group MWGrp

Up:: ControlSend, ListBox1, {Up}, %MainWnd%

Down:: ControlSend, ListBox1, {Down}, %MainWnd%

#IfWinActive

Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.