Jump to content

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

TillaGoto - Go to functions, labels & hks in your script


  • Please log in to reply
135 replies to this topic
fincs
  • Moderators
  • 1662 Beiträge:
  • Last active:
  • Joined: 05 May 2007

I had to include SetFormat,integer,D in ListBoxAdjustHSB+GetListBoxItem

Please use "SetFormat,FastInteger", please! Or else the program runs like a slug (it disables binary number caching)!

Includes also a Fix for SciTE4AutoHotkey toolbar

Where is the fix?

HotKeyIt
  • Moderators
  • 7439 Beiträge:
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
Hi fincs, thanks for pointing to IntegerFast, I've updated above post :)

Where is the fix?

I like QuickMode (use on demand only so it is not running all the time)
But currently when you click on the AHKToolbar4SciTE using QuickMode (bQuickMode := True) TillaGoTo will not show up as SciTE4AutoHotkey is not active, so it does not work.
So here the fix:

;Check if we're in quick mode
If bQuickMode {

;Check if Notepad++ is active
hNPP := WinActive(sActiveWindow)
If Not hNPP
If !WinActive("AHKToolbar4SciTE") {
ExitApp
} else {
WinActivate,%sActiveWindow%
hNPP:=WinExist(sActiveWindow)
}

If Not hNPP
ExitApp
bExitOnClose := True
Gosub SummonGUI
} Else bExitOnClose := False

+ after showing the GUI (line 186)
WinActivate, ahk_id %hGui%
    ControlFocus,, ahk_id %htxtSearch%
EDIT: + optional Position on the left side instead right
If bPosLeft
        Gui, Show, Hide AutoSize x5 y%iY%
    else
        Gui, Show, Hide AutoSize x%iX% y%iY%


TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007
HotKeyIt, I like your AnimateWindow function :D. But there are some annoying little problems with it. I don't think it's something with your function, but rather with the API itself because I had the same problems early on in the project when I tried to use the blend effect instead of manually fading in (like it is now).

What happens is that the TextBox doesn't have any border (when using the blend effect), which looks weird. This can however be remediated using WinSet, Redraw. And also, half the time, there's kind of a flicker at the end of the animation (no matter the effect). I'm not sure where it comes from, but I think it's just a side-effect of using the API. Although it is most noticeable when using the blend effect, it's also there in the other effects as well. The other small annoyance is that the process becomes uninterruptible, which means that pressing Escape while the animation is going will do nothing.

Also, I'm trying to understand why you added SetFormat in the ListBox functions. Is it supposed to be faster? Doesn't AutoHotkey cache the variables numerically by default? I also tried AnimateWindow without the SetFormat, and it worked fine.

TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007
New release:

- Greatly improved analysis speed for large scripts with big comment blocks
- Added bPosLeft (feature suggested by HotKeyIt)
- Added iMargin
- Made the default size a little wider and taller
- Changed default value of sActiveWindow to match both Notepad++ and SciTE4AutoHotkey
- Added the SciTE4AutoHotkey fix by HotKeyIt


About bPosLeft and iMargin:
iMargin  := 2      ;Specify the width of the GUI's margins.
bPosLeft := False  ;Set to True to position the GUI on the left side instead of the right side.


TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007
New release:

- Added bFilterComments
- Added SetBatchLines -1 to the algorithm to make it faster
- Improved even more the comment filtering algorithm to make it even faster (noticeable difference for big scripts)


About bFilterComments:

For extremely large scripts (> 5000 lines, especially with a lot of comments), performance can be enhanced by turning comment filtering off through bFilterComments (default is True). On the same note, you may turn the flag off anyways to improve performance if you're confident your comments do not contain function/label/hotkey-looking text that might get picked up during script analysis.

bFilterComments := True ;Set to True to filter out the functions/labels/hotkeys found in comments.
                        ;Note: this feature greatly reduces performance in large scripts. Therefore, if
                        ;you start experiencing lag, you might want to turn it off (at the expense of
                        ;not filtering out functions/labels/hotkeys found in comments).
                        ;Warning: if turned off, functions must not have comments between the closing
                        ;parenthesis of the declaration and the opening curly bracket. Similarly, labels
                        ;must not have comments on the same line.


fincs
  • Moderators
  • 1662 Beiträge:
  • Last active:
  • Joined: 05 May 2007
Feature request:
Can you process #include lines too? It shouldn't be that hard...
(Loop, RegExMatch, SubStr and FileRead) :3
(Oh, and StdLib too, if you want)

TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007

Feature request:
Can you process #include lines too? It shouldn't be that hard...
(Loop, RegExMatch, SubStr and FileRead) :3
(Oh, and StdLib too, if you want)

If we were talking about an Intellisense system where the user needs to know all the functions he has access to, then I'd understand. But TillaGoto is only meant to help you go to different points in the script you're working on. Also, if the list includes both functions existent in the script, and functions part of an external file, the user will have a harder time distinguishing the two. Also, what should TillaGoto do when the user selects an external function? Should it open up the file and point the cursor to the line definition? That just feels like it's doing more than what it is designed to do.

The user could just open up both files and use TillaGoto in each of them. It just seems like a lot of work for a feature that feels like it's beyond the scope of the script's purpose.

fincs
  • Moderators
  • 1662 Beiträge:
  • Last active:
  • Joined: 05 May 2007

Feature request:
Can you process #include lines too? It shouldn't be that hard...
(Loop, RegExMatch, SubStr and FileRead) :3
(Oh, and StdLib too, if you want)

If we were talking about an Intellisense system where the user needs to know all the functions he has access to, then I'd understand. But TillaGoto is only meant to help you go to different points in the script you're working on. Also, if the list includes both functions existent in the script, and functions part of an external file, the user will have a harder time distinguishing the two. Also, what should TillaGoto do when the user selects an external function? Should it open up the file and point the cursor to the line definition? That just feels like it's doing more than what it is designed to do.

The user could just open up both files and use TillaGoto in each of them. It just seems like a lot of work for a feature that feels like it's beyond the scope of the script's purpose.

Ah, ok ;)
I didn't know that that feature was so outside from the script's purpose...
Anyway, I'm bundling this with the next version of SciTE4AutoHotkey v2
(if the OS >= Windows XP, you know why) :)

HotKeyIt
  • Moderators
  • 7439 Beiträge:
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Also, what should TillaGoto do when the user selects an external function? Should it open up the file and point the cursor to the line definition? That just feels like it's doing more than what it is designed to do.

The user could just open up both files and use TillaGoto in each of them. It just seems like a lot of work for a feature that feels like it's beyond the scope of the script's purpose.


I have been thinking about this as well and I think this feature would be freaking good :D

It would be great if the file would be opened and cursor would jump to the function.

This is my problem about splitting the scripts into several files. So I try to keep all functions and labels together.

This feature would be a great advance in this matter.

- SciTE already recognizes if the file is opened so when you reopen it, it would just activate the tab with that file. So this part is not the problem
- Functions included in another script could be shown Function(.\Tools\hotkeys.ahk) so very easy to recognize
- The only problem I can think of is how to find the file!?
--- for example #include ..\Tools\hotkeys.ahk
------ how could we get the working directory?!? file location + SetWorkingDir command..

@ TheGood - any chance you try it? I will help where I can.

TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007

@ TheGood - any chance you try it? I will help where I can.

Very well. If the two people who care about this script want it, then I'll do it. :D
I have a few other things to do right now, but I will attack the issue ASAP.

HotKeyIt
  • Moderators
  • 7439 Beiträge:
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

@ TheGood - any chance you try it? I will help where I can.

Very well. If the two people who care about this script want it, then I'll do it. :D
I have a few other things to do right now, but I will attack the issue ASAP.


That's awesome, I will be waiting for that great feature patiently :D :D :D

TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007
New release:

- Added iIncludeMode and sPathMatching for #Include file scanning and library files scanning (and opening)
- Removed MsgBoxes in HID_GetInputInfo() which would rarely occur
- Fixed a possible error for when WM_INPUT's handle expired

About iIncludeMode and sPathMatching:
iIncludeMode := 0 ;This setting affects the behaviour of TillaGoto when scanning for script
                  ;labels, functions and hotkeys in #Include files and library files. To turn
                  ;off the feature completely, specify 0. Otherwise, iIncludeMode can be any
                  ;combination of the following values:
                  ;0x00000001 - Scan #Include files
                  ;0x00000010 - Scan library directories files
                  ;0x00000100 - Retrieve functions upon scanning
                  ;0x00001000 - Retrieve labels upon scanning
                  ;0x00010000 - Retrieve hotkeys upon scanning
                  ;0x00100000 - Filter comments upon scanning (similar to bFilterComments)
                  ;0x01000000 - Recurse (ie. include #Include files of #Include files and so on)
                  ;0x10000000 - Append the name of the file to the functions/labels/hotkeys name
sPathMatching := "\*?.*(?= - (Notepad\+\+|SciTE4AutoHotkey))" ;Regular expression which should
                  ;match the path of the currently edited file. Necessary only if iIncludeMode <> 0.


HotKeyIt
  • Moderators
  • 7439 Beiträge:
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Also, I'm trying to understand why you added SetFormat in the ListBox functions. Is it supposed to be faster? Doesn't AutoHotkey cache the variables numerically by default? I also tried AnimateWindow without the SetFormat, and it worked fine.

This was necessary for AutoHotkey < 1.0.48

I will now test new release :), thank you so much.

fincs
  • Moderators
  • 1662 Beiträge:
  • Last active:
  • Joined: 05 May 2007
It's finally here :D

TheGood
  • Members
  • 589 Beiträge:
  • Last active: Mar 22 2014 03:22 PM
  • Joined: 30 Jul 2007
Quick fix:

- Fixed default value of sPathMatching and sActiveWindow so that it better matches SciTE/SciTE4AutoHotkey

:D