Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8794

    CrashNBurn
    Member

    The Find Highlight feature is interesting, though I find it annoying more so than helpful in many cases.

    I’d like to see an option, if possible, on the Find Dialog:

    [X] Erase Find Highlight on Close.

    Thanks.

    #8797

    Yutaka Emura
    Keymaster

    Hi CrashNBurn,

    Thanks for your comments! You can also set “0” in the Character Space text box in the Display tab of configuration properties.

    Thanks!

    #8799

    CrashNBurn
    Member

    That particular setting [ character space: 0 ] appears to increase the spacing between each character of your current font…

    The request was to have a checkbox on the Find-Dialog that can be easily toggled on/off so that when the Find-Dialog is closed the Find Highlights get cleared (when checked) and not cleared (when not checked).

    #8800

    Yutaka Emura
    Keymaster

    Hi CrashNBurn,

    I am sorry. I mean “Search Colors” text box, not “Character Space” in the Display tab of configuration properties.

    Thanks!

    #8804

    CrashNBurn
    Member

    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
    }
    #8845

    CrashNBurn
    Member

    Updated Previous post with much cleaner/functional code.

    #8881

    Jibz
    Member

    I quite like the way Notepad++ does this particular feature. As soon as you select a piece of text that could be an identifier, it will highlight all nearby matches, and when you deselect again the highlight is removed.

    It is quite convenient for quickly seeing places a variable is referenced in a source file.

    #8883

    Yutaka Emura
    Keymaster

    Hello Jibz,

    I might add that feature in future versions of EmEditor.
    Thanks for your comments!

    #9021

    CrashNBurn
    Member

    I updated my AHK fix for this,
    1) Automatically Clear the Find Highlight when you Click [Close] on the Find|Replace dialog.
    2) Does NOT clear the Find highlight if:
    —> you press keyboard {ESC} or
    —> click [X] on Titlebar. or
    —> Shift+Click, or Ctrl+Click.

    #ifWinActive, Find ahk_class #32770, &Search All Open Documents
    {
    $LButton:: IWA_32770_FindReplace( "{LButton Down}" )
    $LButton UP:: IWA_32770_FindReplace( "{LButton Up}" )
    return
    }
    #ifWinActive, Replace ahk_class #32770, Search All &Open Documents
    {
    $LButton:: IWA_32770_FindReplace( "{LButton Down}" )
    $LButton UP:: IWA_32770_FindReplace( "{LButton Up}" )
    return
    }

    WinGetParentClass(winTitle="A", winText="", exTitle="", exText="")
    {
    WinGetClass, wClass, \% "ahk_id " DllCall( "GetParent", "UInt", WinExist(winTitle, winText, exTitle, exText))
    return wClass
    }

    IWA_32770_FindReplace(mKeyF)
    {
    EmEditorMainFrame3_sendKey:="!{F3}", EmEditorMainFrame3_control:="Button16"
    ControlGetFocus, cgFocus
    Send, \% ((wpClass:=WinGetParentClass()) && doKey:=(cgFocus==\%wpClass\%_control)) ? mKeyF : mKeyF
    if( GetKeyState("Ctrl") || GetKeyState("Shift") )
    return
    Send, \% (doKey && (WinGetClass("A")==wpClass) && \%wpClass\%_sendKey) ? \%wpClass\%_sendKey : ""
    return
    }
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone