Make F3 & Shift-F3 work in Find Replace dialog

Fix #2138, close #15063
This commit is contained in:
Alan Kilborn 2024-04-28 20:41:08 -04:00 committed by Don Ho
parent 188375e2ee
commit c63e29f21e
2 changed files with 15 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;