Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6893

    Pancho
    Member

    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
    #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.

    #6899

    Pancho
    Member

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

    I do not want search to all open documents, only active(current document)

    How to get all text document in Selection object ?

    document.selection.SelectAll();
    str = document.selection.text;

    right ? As without the allocation of the entire text (like Ctrl+A) ?

    #6900

    Yutaka Emura
    Keymaster

    Pancho wrote:

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

    I do not want search to all open documents, only active(current document)

    How to get all text document in Selection object ?

    document.selection.SelectAll();
    str = document.selection.text;

    right ? As without the allocation of the entire text (like Ctrl+A) ?

    If you just want to search for selected text (or a word if not selected), how about pressing CTRL + F3? To do this with a macro, you can use:


    document.selection.FindRepeat(eeFindRepeatNext | eeFindRepeatWord);
    #6903

    Pancho
    Member

    not quite so … please see image:

    #6904

    Pancho
    Member

    This really work :-) ehaaaaa
    str = ‘functions+’+document.selection.Text;
    document.selection.Find(str,eeFindNext | eeFindAround | eeFindReplaceRegExp);

    Thanks for advises !!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.