"Highlight All Items Found" interfering with macro (fixed)

"Highlight All Items Found" interfering with macro (fixed)

4
NewbieNewbie
4

    Aug 20, 2009#1

    I have a macro that selects the current line of text (^.+$) and replaces it. Works fine when "Highlight All Items Found" is off. When it's on, the entire file gets selected. Is there a way to turn it off in the macro?

    6,686585
    Grand MasterGrand Master
    6,686585

      Aug 20, 2009#2

      No, this setting can't be controlled from within a macro or a script. Well, this option should not be active during a script or macro execution as the find option List Lines Containing String and since UE v13.20a also the replace option Replace All is from top of file. Originally the find option Highlight All Items Found was no problem for finds executed from within a macro or script because this option was always automatically disabled after the find was executed by the user and macros/scripts could not enable it. It looks like the IDM developers have forgotten that for find option Highlight All Items Found also a special handling must be used as this find option became "permanent enabled" (= remembered) optionally.

      I suggest you send a bug report email to IDM describing the problem with a good example - test file and your macro shortened to demonstrate this issue. The IDM developers have to:
      • save the state of the find option Highlight All Items Found on start of a macro/script
      • set this find option to false (= disabled)
      • restore the state of this find option after exit of the macro/script
      If you want I can also report it although I have to create first an example for demonstration.

      As possible workaround you could use in your macro a replace command instead of a find for selecting the line content and a text write to overwrite the selection as it looks like you are using.

      Also possible would be to use command SelectLine which selects also the displayed line with line termination and therefore the new text must also end with a line termination. Last you could maybe also use

      Code: Select all

      GotoLine 0 1
      StartSelect
      Key END
      EndSelect
      for selecting the line without line termination. Note: SelectLine as well as the code above selects only the just displayed line. That is important if you are using soft word-wrap.

      Update: I could not reproduce anymore with UE hotfix version 13.20a+1 the described problem with macro execution and Highlight All Items Found enabled.

      4
      NewbieNewbie
      4

        Aug 20, 2009#3

        Thanks, Mofi.

        I think one of your workarounds will work for me for now.