Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6373
    iisisrael
    Member

    I want to select text, hit one key, and find the next occurrence USING CURRENT FIND OPTIONS (e.g. “Use Regular Expressions”).

    * Currently, Find Next Word does this EXCEPT for regular expressions. (i.e. “Match Case” is left checked/unchecked, but “Use Regular Expressions” gets unchecked by using Find Next Word).
    * If Find Next Word isn’t the place to do this, then Next should have an option of switching the Find string to the currently selected text (if any selected) without requiring I open the Find… dialog box first. As it is, Next ignores the currently selected text and moves to the next occurrence of the last Find… string.

    This will be a BIG time saver as ergonomics and editing speed / efficiency are a high priority. Thanks.

    #6375
    Yutaka Emura
    Keymaster

    iisisrael wrote:
    I want to select text, hit one key, and find the next occurrence USING CURRENT FIND OPTIONS (e.g. “Use Regular Expressions”).

    * Currently, Find Next Word does this EXCEPT for regular expressions. (i.e. “Match Case” is left checked/unchecked, but “Use Regular Expressions” gets unchecked by using Find Next Word).
    * If Find Next Word isn’t the place to do this, then Next should have an option of switching the Find string to the currently selected text (if any selected) without requiring I open the Find… dialog box first. As it is, Next ignores the currently selected text and moves to the next occurrence of the last Find… string.

    This will be a BIG time saver as ergonomics and editing speed / efficiency are a high priority. Thanks.

    You are right. If you use the same option (Regular expression) always, how about using this macro:


    document.selection.SelectWord();
    s = document.selection.Text;
    document.selection.Find( s, eeFindNext | eeFindReplaceRegExp );

    #6384
    iisisrael
    Member

    I altered it a little to (almost) match what we want to accomplish:

    s = document.selection.Text;
    if (!s) { document.selection.FindRepeat(eeFindRepeatNext); }
    else {
    document.selection.Find( s, eeFindNext | eeFindReplaceRegExp );
    }

    However, the “document.selection.Find” doesn’t replace the string used by “document.selection.FindRepeat”! This means, when I select text and run this macro, then click to erase the selected found text, and run the macro again, it doesn’t repeat the find on the recently selected text find, but finds the text from the last “Find”. How do I replace the last “Find” value?

    Also, if the currently selected text is selected as a result of the find, I don’t want that to become the new find string, I want to continue with the original find string. how do I check to make a distinction between a manually selected string and a string selected by a find? (i.e. I want to repeat my search for the regex, not the next resulting found string from the regex)

    Thanks!

    #6387
    Yutaka Emura
    Keymaster

    iisisrael wrote:
    I altered it a little to (almost) match what we want to accomplish:

    s = document.selection.Text;
    if (!s) { document.selection.FindRepeat(eeFindRepeatNext); }
    else {
    document.selection.Find( s, eeFindNext | eeFindReplaceRegExp );
    }

    However, the “document.selection.Find” doesn’t replace the string used by “document.selection.FindRepeat”! This means, when I select text and run this macro, then click to erase the selected found text, and run the macro again, it doesn’t repeat the find on the recently selected text find, but finds the text from the last “Find”. How do I replace the last “Find” value?

    Also, if the currently selected text is selected as a result of the find, I don’t want that to become the new find string, I want to continue with the original find string. how do I check to make a distinction between a manually selected string and a string selected by a find? (i.e. I want to repeat my search for the regex, not the next resulting found string from the regex)

    Thanks!

    I don’t think there is a good way to replace the last Find value.

    You might want to claer “Use Word at Cursor in Find/Replace Dialog Box” in the Search tab of the Customize dialog box so the Find string will always become the last searched string.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.