Закрыть диалог поиска / замены в Notepad ++ с помощью сочетания клавиш?

2876
John Straka

Когда я выполняю поиск (а не поиск всех, закрывающий диалоговое окно) или заменяю его в Notepad ++, фокус остается на диалоге поиска / замены. Если я хочу сфокусироваться на главном окне с текстом в нем, мне нужно либо щелкнуть, либо неуклюже alt-tab + alt-shift-tab, либо закрыть его, я должен нажать. Есть ли сочетание клавиш для закрытия диалога поиска / замены?

Я прочитал этот вопрос, но он относится к противоположной ситуации - его версия Notepad ++ была сосредоточена на главном окне после поиска или замены, и он хотел вернуть фокус обратно к диалогу.

Я на 64-битной Win7, если это имеет какое-либо значение.

2
Если вы внимательно прочитали [комментарий Нейта] (http://superuser.com/questions/540609/notepad-close-the-find-replace-dialog#comment655072_540609), было ясно, что проблема потери фокуса возникла у пожилых людей. версия Блокнота ++. На более новых версиях диалог остается сфокусированным, и Esc закрывает его, что он также упомянул. Karan 11 лет назад 0
@Karan - упс John Straka 11 лет назад 0
Оказывается, это вызвано Photoshop. Смотри мой ответ. Henrik Erlandsson 8 лет назад 1

3 ответа на вопрос

5
Marcks Thomas

Esc will close the find/replace dialog and return focus to the main window.

Это не работает в самых последних версиях. Ed Cottrell 10 лет назад 0
@EdCottrell: я только что попробовал две самые последние версии, v6.5.2 и v6.5.3. Этот метод все еще работает в обоих. Marcks Thomas 10 лет назад 0
На самом деле, теперь я вижу, что неправильно понял вопрос; Я думал, что OP спрашивает, как закрыть окно Find Results, а не диалог Find / Replace. Вы правы, что `Esc` закроет последнее. Ed Cottrell 10 лет назад 1
Раньше была опция, позволяющая диалогу поиска автоматически скрываться после первого поиска. Это все еще вокруг? will 9 лет назад 0
Нет, больше нет. Я тоже на Win 7 64-битная. Необходимость щелкать мышью при написании кода должна быть вне закона! Или что-то. Henrik Erlandsson 8 лет назад 0
Смотрите мой ответ для решения. Henrik Erlandsson 8 лет назад 0
0
Ed Cottrell

Edit: I misread this question originally and thought it was asking how to close the Find Results window. The bulk of my answer below addresses the Find Results window. For the Find/Replace dialog, Marcks Thomas posted the correct answer - Esc will do the trick.


There is no keyboard shortcut to close the Find Results window. It is possible to create a hotkey, however, using AutoHotKey. The following script will convert F7 from an open-only shortcut to a toggle; it opens it if it isn't already open, and closes it if it is.

Here is the script:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Ed Cottrell's AutoHotKey script for toggling the "Find Results" pane/window in Notepad++ ; Released under the MIT License (http://opensource.org/licenses/MIT) ; Version: 1.1 ; Release Date: January 15, 2014 ; Released on Superuser.com: http://superuser.com/questions/700357/create-a-hotkey-keyboard-shortcut-to-close-the-notepad-find-results-window ; Also released at www.edcottrell.com/2014/01/11/toggle-find-results-window-notepad-hotkey/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Turn F7 into a toggle for the Notepad++ search results window; currently it shows it, but doesn't hide it. ; The $ prevents this from firing itself *$F7:: Open := 0 SetTitleMatchMode 2 ; AHK doesn't seem to recognize the window title otherwise ; See if Notepad++ is the active window or if the undocked results window (ahk_class #32770) is the active window If WinActive("Notepad++") { ; If the results pane is open, close it ; Button1 is the class name for the title bar and close button of the results pane when docked ControlGet, OutputVar, Visible,, Button1, Notepad++ if ErrorLevel = 0 { If OutputVar > 0 { ; Found it docked Open := 1 ; Get the size and coordinates of the title bar and button ControlGetPos, X, Y, Width, Height, Button1 ; Set the coordinates of the close button X := Width - 9 Y := 5 ; Send a click ControlClick, Button1,,,,, NA x%X% y%Y% } } } ; If it is undocked, use ahk_class #32770 else If WinExist("Find result ahk_class #32770") { ; Found it undocked Open := 1 ; Close it WinClose } ; It's not open, so open it if Open = 0 { SendInput } return 

I hope this helps everyone else out there who loves Notepad++!

Edited to fix error in detection of undocked window.

0
Henrik Erlandsson

This is the cause, tested by me, and suddenly the Esc key works in npp :)

Photoshop causing other programs not receive ESC key

Похожие вопросы