06-28-2019, 02:56 PM
something like this
just need to get the starting position and the end position of the text
then select the text and paste sorted textÂ
just need to get the starting position and the end position of the text
then select the text and paste sorted textÂ
str s=sub.getAutotextItem("At")
ARRAY(str) a=s
a.sort(2)
s=a
out s
;code: Write the sort result to the original file
mac+ "At"
int h=GetQmCodeEditor
SendMessage(h SCI.SCI_GOTOLINE 1 0)
int ssp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
SendMessage(h SCI.SCI_GOTOLINE 1+numlines(s) 0)
int sep=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
SendMessage(h SCI.SCI_SETSEL ssp sep)
s.setclip
SendMessage(h SCI.SCI_PASTE 0 0)
#sub getAutotextItem
function~ ~name
str pattern="(?m)^(.+\s\:.+)"
_s.getmacro(name 0)
str ss d
int i
ARRAY(str) a
findrx(_s pattern 0 4 a)
for i 0 a.len
,d.formata("%s[]" a[0 i].trim)
ret d