EmEditor (text editor) Forum Index
   EmEditor Core Enhancement Suggestions
     Automatic: Erase Find Highlight
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
CrashNBurn
Posted on: 7/27/2010 3:33 pm
Just can't stay away
Joined: 4/8/2010
From:
Posts: 130
Re: Automatic: Erase Find Highlight
I didn't want to disable the Find Highlight.
My request was to to automatically clear the Find Highlight when the Find Dialog was closed -- if a checkbox on the find dialog was checked: [x] Clear Highlights.

I solved it with AutoHotKey. The original AHK solution was Kludgy and didn't work consistently.

Perhaps someone else will find some use for it.
Fixed clean code:
;;
;;  Script: EE_AutoClearFindHighlight.ahk
;;  Author: MwM - Crash&Burn, 2010
;;  Usage:: 
;;    Automatically clear the Find Highlight when EmEditor's
;;    Find Dialog is closed with the [Close] Button.
;;
;;    Does not clear the Find Highlight if ESC, or the 
;;    Find Dialog's TitleBar [X] is used, nor if a modifier
;;    key is held down when clicking [Close] (i.e. Shift)
;;
  #SingleInstance, Force 
  #NoEnv
SetBatchLInes, -1

#ifWinActive, Find ahk_class #32770
{
  ~LButton::
; $ESC::
  {  
    aParent := DllCall( "GetParent", UInt, WinExist("A") )
    aParent := (( !aParent ) ? WinExist("A") : aParent )
    WinGetClass, aClass, ahk_id %aParent% 
    if( aClass <> "EmEditorMainFrame3" )
      return
    if( A_ThisHotKey == "LButton" )
    {
      MouseGetPos, ,, aFind, aControl
      if( aControl <> "Button16" )
        return
      KeyWait, LButton
      Sleep, 50
      ifWinExist, ahk_id %aFind%
        return
      WinWaitActive, ahk_class EmEditorMainFrame3
      Send, !{F3}
    }
    ;; If one wanted the Find Highlight to clear on ESC
    ;; Remove comment block below, and uncomment ESC above.
    /*
     *
    else    
    if( A_ThisHotKey == "$ESC" )        ;;  Not clearing Find Highlight on ESC, atm
    {
      Send, {ESC}
      Sleep, 50
      ifWinExist, ahk_id %aFind%
        return
      WinWaitActive, ahk_class EmEditorMainFrame3
      Send, !{F3}
    }
     *
     */
  return
  }
return
}  
Flat Previous Topic | Next Topic


Subject Poster Date
   Automatic: Erase Find Highlight CrashNBurn 7/26/2010 3:04 pm
     Re: Automatic: Erase Find Highlight Yutaka 7/26/2010 6:42 pm
       Re: Automatic: Erase Find Highlight CrashNBurn 7/27/2010 8:49 am
         Re: Automatic: Erase Find Highlight Yutaka 7/27/2010 12:29 pm
       » Re: Automatic: Erase Find Highlight CrashNBurn 7/27/2010 3:33 pm
           Re: Automatic: Erase Find Highlight CrashNBurn 8/16/2010 10:39 pm
             Re: Automatic: Erase Find Highlight Jibz 8/26/2010 5:06 am
               Re: Automatic: Erase Find Highlight Yutaka 8/26/2010 9:53 am
                 Re: Automatic: Erase Find Highlight CrashNBurn 9/28/2010 3:55 pm

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文