You are here: PSPad forum > English discussion forum > Update AutoHotkey integration

Update AutoHotkey integration

#1 Update AutoHotkey integration

Posted by: toralf | Date: 2015-04-02 10:02 | IP: IP Logged

I have currently two requests regarding integration of AutoHotkey in PSPad

1) The files that come with PSPad regarding AutoHotkey are slightly outdated.
Would you allow me to send you updated files that you could include in PSPad?

2) Recently new features, e.g. class and method definitions, were added to AutoHotkey syntax. Would you be willing to update the ftAHK code explorer if I'd send you an example file?

Options: Reply | Quote | Up ^


#2 Re: Update AutoHotkey integration

Posted by: pspad | Date: 2015-04-02 11:24 | IP: IP Logged

Hello

"Yes" to your both answers.

Options: Reply | Quote | Up ^


#3 Re: Update AutoHotkey integration

Posted by: myf | Date: 2015-04-02 13:33 | IP: IP Logged

BTW, Autohotkey currently requires BOM for non-ANSI scripts, what brings back ye olde request about per-file UTF-8 BOM settings. (Apparently no PSPad + AHK user out there complained (except me :]) so maybe everyone uses either old AHK, plain ANSI versions or are OK with global BOM setting.)

Options: Reply | Quote | Up ^


#4 Re: Update AutoHotkey integration

Posted by: toralf | Date: 2015-04-02 14:30 | IP: IP Logged

I use AHK 32bit Unicode, but my scripts are in ANSI code page

Options: Reply | Quote | Up ^


#5 Re: Update AutoHotkey integration

Posted by: toralf | Date: 2015-04-12 03:23 | IP: IP Logged

pspad:
"Yes" to your both answers.

I have send you an email with files.

--
Ciao
toralf

Options: Reply | Quote | Up ^


#6 Re: Update AutoHotkey integration

Posted by: toralf | Date: 2015-04-13 16:39 | IP: IP Logged

Thank you for the latest PSPad version.
It already improved a lot in the code explorer.
And also the improved INI and DEF file will help other users of AHK.

I do have some questions though:
[tested with PSPad 4.6.0 (2658)]

1) With the test code I send you earlier, the current code explorer shows a few false positives
Line 119: LV_Delete()
Line 120: LV_Add()
Line 121: FuncCall8()
Line 122: FuncCall9()
All are pure function calls and not function definitions. (they are missing a "{") Is there a chance that you can eliminate these false positives?
Would it help if I provide RegEx for this?

2) Function and Method Definitions with the parameters broken down over several lines, do not show in the code explorer

Line 140: MultilineFuncDef(Param1 ; with comment
Line 141: , Param2
Line 142: , Byref Param3)
Line 143: {
and
Line 146: OTBMultilineFuncDef(Param1
Line 147: , Param2
Line 148: , Param3){ ;comment
and
Line 207: MultilineMethod(Param1
Line 208: , Param2
Line 209: , Param3) {

Is there any chance these can be recognized and shown in the code explorer?
Would it help if I provide RegEx for this?

3) The AutoHotkey.INI file has some differences in the [Settings] sections to the file that I send you.
a) IndentChar and UnIndentChar are not set, they should be "{" and "}"
b) TabWidth is zero, and should be 2
c) SingleQuote is set to 1, but should be zero, since single quotes are not used to identify quoted strings in AHK
d) KeyWordChars is set to "-_#". In AHK variable names are allowed to have "_$@#" in them, but no "-". The internal variables only use a "_". Directives use a "#" as their first character. To allow the syntax highlight to work on directives KeyWordChars should be "_$@". Since this this setting also has an influence on how Labels are highlighted I would reduce it to "_", because Labels with e.g. a "$" in them do not show up in the code explorer but would get the syntax highlight of a Label when "$" is in KeyWordChars.
e) DocComment is not set at all.

Is there a reason you set a), b), c) and d) differently to my file?

I like the way you implemented the classes into the code explorer. Thanks a lot.

PS: If I should provide RegEx for 1) and 2), please let me know in which 'dialect' of RegEx and maybe with your currect RegEx Needle you are using as an example to start from.

Again Thanks a lot for the updates so far.

--
Ciao
toralf

Options: Reply | Quote | Up ^


#7 Re: Update AutoHotkey integration

Posted by: pspad | Date: 2015-04-13 17:03 | IP: IP Logged

For explanation, parser runs line by line.

To false positive functions and multiline declarations:
I can detect as function delaration line, where is a {
but it won't list:

Quote:
function ()
{ ...

I think false positives now are better then it

Same problem is with multiline function declaration. From one line I am not able to detect it sad smiley

Now I used your autohotkey syntax file and changed ` as escape char only so all will be as you want to have it.

In the Class explorer, I am sorry, but I forgot to expand classes automatically. It will be available in the next build.

Options: Reply | Quote | Up ^


#8 Re: Update AutoHotkey integration

Posted by: toralf | Date: 2015-04-13 17:57 | IP: IP Logged

Thank you,
that explains 1) and 2). I think it can stay then as it is now.

The escape char is exactly how it should be, thanks.

--
Ciao
toralf

Edited 1 time(s). Last edit at 2015-04-13 17:58 by toralf.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR