I have updated the insertExt.ini to include support for subroutines.
Here it is:
[Function List]
Show all functions=1
Sort by names=1
showCmd=0
[User Languages]
Count User Languages=1
Name 1=AHK Autohotkey
KeyWBodyBeg 1=
KeyWBodyEnd 1=
MatchCase 1=0
Count Comment 1=1
Count Syntax 1=4
Syntax P1.1.1=^
Syntax P2.1.1=\([^(]*\)
Syntax P3.1.1=[a-zA-Z0-9@?#\[\]_]+
Syntax P4.1.1={
Syntax P5.1.1=}
Syntax P6.1.1=$
Syntax P1.2.1=
Syntax P2.2.1=
Syntax P3.2.1=[#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:][ \t]*$
Syntax P4.2.1=
Syntax P5.2.1=
Syntax P6.2.1=
Syntax P1.3.1=^
Syntax P2.3.1=[ \t]*$
Syntax P3.3.1=[a-zA-Z0-9@?#\[\]_]+[:]
Syntax P4.3.1=
Syntax P5.3.1=^[Rr]eturn[ \t]*$
Syntax P6.3.1=$
Comment P1.1.1=/*
Comment P2.1.1=*/
Syntax P1.4.1=
Syntax P2.4.1=
Syntax P3.4.1=
Syntax P4.4.1=
Syntax P5.4.1=
Syntax P6.4.1=
[HEX-Editor]
Columns=16
Bits=1
Binary=0
Little=0
Capitel=0
Extensions=.exe .dll
As usual, some rules to use this insertExt.ini
/* Some Rules
If calling a function, make sure to indent the calling function
Function definition should not be indented or leave any spaces in the front
In the function argument block, if there are comments, don't use any more ()
When making a subroutine label, make sure don't use any indentation or leave any spaces in the front, just like function definition, same with the return statement which end the subroutine.
For example:
Sub1:
; your code blocks here
; there could be more return statement in between
; you should indent those earlier return statement (usually under certain if conditioning statement
Return
Sub1 should be correctly picked up in the function lists now.
*/
I also went to the Notepad++ plugin developement forum asking for some help, as the parser for function list plugin will treat the following if statement (in C/C++) as functions:
if(x>y) {
printf("x is bigger than y");
} else {
if(x<y) {
printf("x is smaller than y");
} else { // x=y
printf("x is the same as y");
}
}
This demonstrates the problem with function list displaying problem is not unique in ahk script. This enhances my belief that if you follow a strict rule of coding, you may more likely to succeed. As a matter of fact, since ahk support is not built in, we can succeed way faster than those built-in languages. The problem I mentioned above still exists in the newest version of NPP, however, if you use my insertExt.ini, and follow the rules I mentioned above, you eliminate the problem right away.
This is usually possible with your own code. However, what if you are reading other people's code. To quickly modify it, I recommend to use the toralf's Auto-Syntax-Tidy.ahk, pick a style you like.
This will usually solve majority of the problem. Except making function calls in the autoexec section of the code. I recommend the C/C++ approach. Convert your autoexec into a subroutine called Main, keep it on the stop of your script, so it will still be autoexecuted.
Main:
; your original autoexec code for ahk script
Return
; your other code
This works in 98% of the time, on some weird situations, Subroutine labels could be displayed in the function list twice for the same Subroutine, I tried in vain to fix it. I can produce examples here if some of you are interested and may want to help to find a solution.
Anyway, hope this is helpful for some of you who are using Notepad++ to do ahk scripting. ( I am a total newbie to Notepad++ as well )
There is a bug in the userLangDefine.xml which affecting the folding capability, I have no idea how to modify the userLangDefine.xml.
Use the following example, load into your Notepad++
If RadUpdateOnClick {
;dosomething
}Else { ; dosomethingelse
}
;;;add a whole bunch of code afterwards
string2 = {
string1 := "{"
;MsgBox % StrLen(string2) StrLen(string1)
If(string1=string2)
MsgBox, They are the same
}
What is going to happen is, the if block will include everything afterwards as if they are all on the same block. After many trial and error, I found out, if you leave a space between } and Else, the problem disappears. Go ahead and try it for yourself.
Anyway, these are my 2 cents for the community.