1 more error correction
when cursor is in the last subfunction doesn't select all the code fixed below
Function Function2
Trigger Aq
when cursor is in the last subfunction doesn't select all the code fixed below
Function Function2
Trigger Aq
out
int h=GetQmCodeEditor
int pos=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
int line=SendMessage(h SCI.SCI_LINEFROMPOSITION pos 0)
_s.getmacro
for _i line 0 -1
,str s.getl(_s _i)
,if(s.beg("#sub"))
,,break
int selLineStart=SendMessage(h SCI.SCI_POSITIONFROMLINE _i+1 0)
for int'i _i+1 numlines(_s)
,str ss.getl(_s i)
,if(ss.beg("#sub"))
,,break
,else
,,str ct.addline(ss -1)
out ct
if(i<>numlines(_s))
,i-1
int selLineEnd=SendMessage(h SCI.SCI_POSITIONFROMLINE i 0)
SendMessage(h SCI.SCI_SETSEL selLineStart selLineEnd)
int fpos=ct.findreplace("aa1" "aaaaaaaaaaaaaaaa1" 4)
if(fpos = -1)
,out "not found"
,end
SendMessage(h SCI.SCI_REPLACESEL 0 ct)