#6897
Yutaka Emura
Keymaster

Pancho wrote:
Hello
I need go and Highlight function by name.
1. Select text : ‘HLfunc’
2. run Macro
3. go to line which contains ‘function HLfunc ‘

Help or advice please

I tried example:

wnd = FindWindow( "EmEditorView", "" );
str = wnd.Caption;
name = document.selection.Text;
pat = 'tions+'+name;
rgx = new RegExp(pat,'i');
results = str.search(rgx);
alert( 'pat: '+pat+"nresults: "+ results);

//function HLfunc

You should be able to do this by using the Find method (of the Selection object) with eeFindReplaceOpenDoc parameter to search all open documents.

Alternatively, you can use the Projects plug-in to enable symbol list, and press F12 to jump to the definition of a symbol at the cursor.