From 174ae29f185974297b2fd53bbb04d8fcef39fa68 Mon Sep 17 00:00:00 2001 From: Jack Tolfree Date: Thu, 24 Sep 2020 20:48:38 +0100 Subject: [PATCH] Add ESC keystroke shortcut to close Search Results Window Closes the focused Search Results Window by hitting ESC. Close #2946, close #8898 --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 345ba20ae..9262b9de8 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -3191,12 +3191,14 @@ void FindReplaceDlg::doDialog(DIALOG_TYPE whichType, bool isRTL, bool toShow) LRESULT FAR PASCAL FindReplaceDlg::finderProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - if (message == WM_KEYDOWN && (wParam == VK_DELETE || wParam == VK_RETURN)) + if (message == WM_KEYDOWN && (wParam == VK_DELETE || wParam == VK_RETURN || wParam == VK_ESCAPE)) { ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); Finder *pFinder = (Finder *)(::GetWindowLongPtr(pScint->getHParent(), GWLP_USERDATA)); if (wParam == VK_RETURN) pFinder->gotoFoundLine(); + else if (wParam == VK_ESCAPE) + ::SendMessage(::GetParent(pFinder->getHParent()), NPPM_DMMHIDE, 0, reinterpret_cast(pFinder->getHSelf())); else // VK_DELETE pFinder->deleteResult(); return 0;