Function Function2
Trigger Aq![Help - how to add the trigger to the macro Help - how to add the trigger to the macro](images/qm/help.png)
if you want to return cursor to original position add
as the last line
Trigger Aq
![Help - how to add the trigger to the macro Help - how to add the trigger to the macro](images/qm/help.png)
out
int h=GetQmCodeEditor
int pos=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
int line=SendMessage(h SCI.SCI_LINEFROMPOSITION pos 0)
int selLineStart=SendMessage(h SCI.SCI_POSITIONFROMLINE line+1 0)
str ct
_s.getmacro
for int'i line+1 numlines(_s)
,str ss.getl(_s i)
,if(ss.beg("#sub"))
,,break
,else
,,ct.addline(ss -1)
out ct
int selLineEnd=SendMessage(h SCI.SCI_POSITIONFROMLINE i-1 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)
if you want to return cursor to original position add
as the last line