AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TillaGoto - Go to functions, labels & hks in your script
Goto page Previous  1, 2, 3, 4, 5, 6, 7
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
TheGood



Joined: 30 Jul 2007
Posts: 399

PostPosted: Mon Feb 08, 2010 1:22 am    Post subject: Reply with quote

DerRaphael wrote:
is it just me or does the scan function not include the currently open tabs of SciTe?

i usually have a set of scripts open which represent a complete project and only the main ahk script contains the includes. so a jump to a function used within a project leads to nuffin, since it is neither in my stdLib folder nor in any includes.

probly i just overlook something...

otherwise this programm is a real ease for SciTe Smile

thx so much for this one.


Hey DerRaphael,
No, it does not scan other open tabs (in any of the editors). It will only scan the current script, and any include files of that script.

Not sure what you mean by
Quote:
a jump to a function used within a project leads to nuffin

If the function is listed, then TillaGoto will bring you to it when you select it.
Back to top
View user's profile Send private message Visit poster's website
TheGood



Joined: 30 Jul 2007
Posts: 399

PostPosted: Sun Feb 14, 2010 6:16 am    Post subject: Reply with quote

New version released. I have to say guys, this is a huge update! I'm really happy of the ScanFile directive (partly inspired by DerRaphael's post).

Changelog wrote:
Major changes:
- Added ScanFile directive
- Added ability to differentiate identically named functions/labels/hotkeys from different #Include/library files
- Aligned appended filenames to the right
- TGcache files are deleted even if last instance didn't exit properly
- Fixed bug where TillaGoto would stop showing when called
- Fixed line history not working across multiple scripts

Minor changes:
- Improved bWideView implementation (and fixed hscrollbar showing up under certain conditions)
- Improved middle click implementation
- Changed hotkey focusing behaviour
- Different symbols when appending names of include files ("#") and library files ("\")
- Added bTrayIcon (default True)
- Added iControlFontSize (default 8)
- Added fControlFont (default Courier New)
- Changed default value of bCacheFiles to True
- Changed default value of iIncludeMode to 0x10100101 (scan include files for functions and append name)
- Minor fixes and improvements


About the ScanFile directive:
Code:
  ScanFile allows you to force TillaGoto to always scan a file, as if it was an Include file, even though it isn't
used with the #Include directive. The directive is processed in exactly the same way as an #Include file would be.
For example, the directive ";TillaGoto.ScanFile = %A_ScriptDir%\script.ahk" will have the same effect as if
TillaGoto saw the directive "#Include %A_ScriptDir%\script.ahk". Directories to change the working directory
are also supported. The variable iIncludeMode must contain the 0x00000001 option in order to work.

  Note that the ScanFile directives are queued up and processed right after the script's actual #Include files are
scanned. Therefore, it doesn't matter where they are placed relative to the actual #Include directives, but the
order in which they are written does (in order to be able to change the working directory of subsequent ones).
The working directory is set back to %A_ScriptDir% before processing them.
  The ScanFile feature is useful when working inside a project with many satellite files. A simple ScanFile
directive to the main script in each satellite file will allow access to all the functions no matter on which
file you're working on.


About bTrayIcon:
Code:
bTrayIcon           := True     ;Set to True to show the tray icon, False to keep it hidden.


About iControlFontSize and fControlFont:
Code:
iControlFontSize    := 8        ;Specify the size of the font for the textbox and listbox.
fControlFont        := "Courier New" ;Name of the font for the textbox and listbox. Must be monospace for proper
                                ;alignment. A better font than Courier New would be Consolas.


There are also quite a lot of small and not so small changes that helps make TillaGoto more user-friendly.
Back to top
View user's profile Send private message Visit poster's website
DerRaphael



Joined: 23 Nov 2007
Posts: 704
Location: % ( RegExMatch( A_AppData, "^(?P<_Home>.*)\\", A ) ? A_Home : "" )

PostPosted: Sun Feb 14, 2010 3:13 pm    Post subject: Reply with quote

hi, since a new version of TillaGoto introduces new features, but also overrides any previously set settings, i decided to bring up this lil subroutine, which may be added to the main tillaGoto script.

it needs to be invoked after the public variables definition atm this is around line #128 with

Code:
Gosub, IniCheck


Simply add this codeblock to the tillaGoto script, so the previous mentioned gosub run will work, too

Code:
; TillaGoto IniSaver
; (w) Feb 2010 by derRaphael / Licensed under EUPL 1.1 or later
; see http://ec.europa.eu/idabc/eupl for a version in your language

IniCheck:

   SplitPath, A_ScriptName,,,, OutNameNoExt
   IniFileName := OutNameNoExt ".ini"
   
   tg_matchWindows := "sActiveWindow,sScintillaClass,sPathMatching"
   tg_appearance   := "bTrayIcon,iGUIWidth,iGUIHeight,iMargin,iTransparency,"
                . "bPosLeft,bWideView,cGUIBG,cControlBG,cControlFG,iControlFontSize,fControlFont"
   tg_hotkeys      := "uSummonGUI,uGoBack,uGoForward,uGotoDef"
   tg_behvaiour    := "bFilterComments,bQuickMode,bMatchEverywhere,bUseMButton,iCancelWait,"
                . "iIncludeMode,bCacheFiles,bDirectives"

   tg_sections     := "matchWIndows,appearance,hotkeys,behaviour"
   
   tg_readIni      := ( FileExist( IniFileName ) )

   Loop, Parse, tg_sections, @,
   {
      tg_currentSection := A_LoopField
      Loop, Parse, tg_%tg_currentSection%, @,
      {
         tg_currentName  := A_LoopField
         tg_currentValue := %tg_currentName%
         
         If ( tg_readIni )
         {
            IniRead, %tg_currentName%, %IniFileName%, %tg_currentSection%, %tg_currentName%, %tg_currentValue%
         }
         Else
         {
            IniWrite, %tg_currentValue%, %IniFileName%, %tg_currentSection%, %tg_currentName%
         }
      }
   }

Return


the code is meant to do two things: on 1st run it creates an ini file and dumps all set public variables into it. on each run afterwards, it overrides the public default variables by the values found in the ini. so ... if a future version of tillaGoto is to be published, it will keep your previously set values.

greets
dR
_________________
    Code:
    /* no comment */
Back to top
View user's profile Send private message
wiseley



Joined: 22 Apr 2009
Posts: 21

PostPosted: Sun Feb 14, 2010 4:59 pm    Post subject: Reply with quote

It seems like your script doesn't work with AutoHotkeyU and getting text from Scintilla with the function below doesn't work either. Do you know what the problem is? Sad
Code:

Sci_GetText(hSci)
{   
    ;Used constants
    SCI_GETLENGTH := 2006
    SCI_GETTEXT := 2182
    ;Retrieve text length
    SendMessage SCI_GETLENGTH, 0, 0,, ahk_id %hSci%
    iLength := ErrorLevel   
    ;Open remote buffer (add 1 for 0 at the end of the string)
    RemoteBuf_Open(hBuf, hSci, iLength + 1) 
    ;Fill buffer with text
    SendMessage SCI_GETTEXT, iLength + 1, RemoteBuf_Get(hBuf),, ahk_id %hSci%   
    ;Read buffer
    VarSetCapacity(sText, iLength)
    RemoteBuf_Read(hBuf, sText, iLength + 1)   
    ;We're done with the remote buffer
    RemoteBuf_Close(hBuf)   
    Return sText
}
Back to top
View user's profile Send private message
fincs



Joined: 05 May 2007
Posts: 474
Location: Seville, Spain

PostPosted: Sun Feb 14, 2010 9:15 pm    Post subject: Reply with quote

Scintilla uses either the system codepage or UTF-8.
_________________
fincs
SciTE4AutoHotkey v2 script editor
[AutoHotkeyCE] [AutoHotkey_L]
Back to top
View user's profile Send private message
noise



Joined: 14 May 2009
Posts: 42
Location: UK

PostPosted: Thu Feb 25, 2010 4:39 pm    Post subject: Reply with quote

I have found that TillaGoto will error if there is #include on the last line of the script. Not sure if it's been mentioned previously.
Back to top
View user's profile Send private message Visit poster's website
TheGood



Joined: 30 Jul 2007
Posts: 399

PostPosted: Thu Feb 25, 2010 5:05 pm    Post subject: Reply with quote

noise wrote:
I have found that TillaGoto will error if there is #include on the last line of the script. Not sure if it's been mentioned previously.

Yes, I'm aware of that bug, and already fixed it for the next release.
Thanks!
Back to top
View user's profile Send private message Visit poster's website
TheGood



Joined: 30 Jul 2007
Posts: 399

PostPosted: Fri Feb 26, 2010 1:58 am    Post subject: Reply with quote

New release. Mostly fixes and improvements to increase stability.

Changelog wrote:
- Added sMustExist and bQuitWithEditor
- Added bAlignFilenames

- Fixed include directive scanning not following working directory changes
- Fixed #Include lines at the end of the script causing TillaGoto to stick in a loop
- Improved Include regex to support IncludeAgain and the *i option
- Improved label and hotkey scanning to include all valid labels and hotkeys

- Improved main loop and hotkey implementation
- Improved accuracy of various regexes
- Improved configuration documentation
- Improved bQuickMode implementation
- Improved filename alignment implementation
- Minor fixes and improvements
- Changed symbols when appending names of include files ("\") and library files ("|") because the previous symbol was too common in hotkeys


About sMustExist and bQuitWithEditor:
Code:
bQuitWithEditor     := False    ;Set to True to make TillaGoto terminate when the editor is also terminated. If
                                ;set to True, please also see sMustExist.
sMustExist          := "ahk_class (Notepad(\+\+|2)|SciTEWindow)" ;Needed if bQuitWithEditor is True. This regex
                                ;will make TillaGoto quit if a matching window does not exist. It is currently set
                                ;to match the editors' classes, but it may be set to match anything else.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7
Page 7 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group