diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 949bde60a..1b39165cc 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1535,6 +1535,17 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA display(false); break; + case IDM_SEARCH_FINDNEXT: + case IDM_SEARCH_FINDPREV: + { + if (HIWORD(wParam) != 1 || + (getCurrentStatus() != DIALOG_TYPE::FIND_DLG && + getCurrentStatus() != DIALOG_TYPE::REPLACE_DLG)) + { + return FALSE; + } + [[fallthrough]]; + } case IDC_FINDPREV: case IDC_FINDNEXT: case IDOK : // Find Next : only for FIND_DLG and REPLACE_DLG @@ -1549,11 +1560,11 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA bool direction_bak = _options._whichDirection; - if (LOWORD(wParam) == IDC_FINDPREV) + if (LOWORD(wParam) == IDC_FINDPREV || LOWORD(wParam) == IDM_SEARCH_FINDPREV) { _options._whichDirection = DIR_UP; } - else if (LOWORD(wParam) == IDC_FINDNEXT) + else if (LOWORD(wParam) == IDC_FINDNEXT || LOWORD(wParam) == IDM_SEARCH_FINDNEXT) { _options._whichDirection = DIR_DOWN; } diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index ac295c8be..f6205225c 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -563,7 +563,8 @@ void Accelerator::updateShortcuts() incrFindAcc.push_back(_pAccelArray[offset]); if (shortcuts[i].getID() == IDM_SEARCH_FIND || shortcuts[i].getID() == IDM_SEARCH_REPLACE || - shortcuts[i].getID() == IDM_SEARCH_FINDINFILES || shortcuts[i].getID() == IDM_SEARCH_MARK) + shortcuts[i].getID() == IDM_SEARCH_FINDINFILES || shortcuts[i].getID() == IDM_SEARCH_MARK || + shortcuts[i].getID() == IDM_SEARCH_FINDNEXT || shortcuts[i].getID() == IDM_SEARCH_FINDPREV) findReplaceAcc.push_back(_pAccelArray[offset]); ++offset;