AutoHotkey Community

It is currently May 27th, 2012, 2:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 131 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next
Author Message
 Post subject:
PostPosted: February 8th, 2010, 1:22 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
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 :)

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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2010, 6:16 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2010, 3:13 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
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

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2010, 4:59 pm 
Offline

Joined: April 22nd, 2009, 6:04 am
Posts: 29
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? :(
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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2010, 9:15 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Scintilla uses either the system codepage or UTF-8.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2010, 4:39 pm 
Offline

Joined: May 14th, 2009, 12:43 pm
Posts: 57
Location: UK
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2010, 5:05 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 1:58 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Regular expression Bug?
PostPosted: August 17th, 2010, 10:30 am 
Offline

Joined: August 12th, 2010, 7:05 am
Posts: 13
Great work!
But there is a little bug on"Regular expression which should match the window of the editor containing the Scintilla control", if there were more than two tabs, tillaGoto would not be activated. Some fixes maybe necessary, like below:


Code:
sActiveWindow       := "\.ahk (-|\*) (Notepad(\+\+|2)|SciTE(4AutoHotkey)?( \[.*?\])?)$" ;Regular expression which


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 17th, 2010, 4:25 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
Thanks for reporting it! Which editor are you using?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2010, 7:24 pm 
request, make Middle Click hotkey configurable as well :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2010, 11:31 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
Another suggestion, it would be nice to specify a default "main" file which contains all the includes so that no include statements for this script are needed in each file. This is useful for larger projects with lots of includes.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2010, 8:58 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
guest3456 wrote:
request, make Middle Click hotkey configurable as well :)

You mean, be able to choose the mouse button? The keyboard hotkey is configurable through uGotoDef.

fragman wrote:
Another suggestion, it would be nice to specify a default "main" file which contains all the includes so that no include statements for this script are needed in each file. This is useful for larger projects with lots of includes.

I think the ScanFile directive is what you want (check the comment block at line 113). Or I might have misunderstood what you meant.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 20th, 2010, 1:44 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
No, I think it is not. I'm talking about a global ScanFile directive, instead of having to place that directive into every script file of a project. Or am I misunderstanding something here and it is possible to define this globally?

Edit: I tried adding
Code:
ScanScriptFile("C:\Program Files\AutoHotkey\7plus.ahk", iIncludeMode & 0x01000000, False, True)
after line 809, but it makes ahk_l (ANSI 32 bit) crash when I middle click on a function. This only happens when the recurse bit is set. I suppose it might be an infinite loop, but it's hard to tell for me without having understood the complete code.

Adding
Code:
Loop, C:\Program Files\AutoHotkey\*.ahk, 1, 1
  ScanScriptFile(A_LoopFileLongPath, 0, False, False)
at this place is not working either, even when I disable recurse and lib folder scanning.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 20th, 2010, 9:52 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
Ah OK, I see what you mean.
Hmm... I'll consider it.

fragman wrote:
Edit: I tried adding [code]

Definitely not the right place for it. If you want to hard hack it, put that ScanScriptFile() call at 831 instead.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 131 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], MSN [Bot] and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group