Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set/Get Bookmark in QM Editor item
#2
This version also supports "go to #sub".

Function GetBookm
Trigger SF12     Help - how to add the trigger to the macro
Code:
Copy      Help
;get QM editor text
str s.getmacro; if(!s.len) ret

;find all '#sub Name' and ' $BkM optional name' lines
ARRAY(CHARRANGE) a; int i
if(0=findrx(s "(?m)^(?:#sub +(\w+)| \$BkM\b([^\r\n]*))" 0 4 a)) ret

;format items text for ListDialog
str items t
for i 0 a.len
,int isBM=s[a[0 i].cpMin]!='#'
,CHARRANGE& r=a[1+isBM i]
,int n=r.cpMax-r.cpMin; if(n>0) t.get(s r.cpMin n); t.trim; else t=""
,items.formata("%i %s[]" isBM t)

i=ListDialog(items "Subfunctions and code bookmarks" "Go to" 128|4 0 0 0 0 0 "$qm$\function.ico[]$qm$\favorites.ico")-1
if(i<0) ret
int c=GetQmCodeEditor
SendMessage(c SCI.SCI_GOTOPOS a[0 i].cpMin 0)

From SetBookm I removed everything above
int c=GetQmCodeEditor


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)