Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FindNext and FindPrevious shortcut keys work in Find and Replace window #15063

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion PowerEditor/src/WinControls/shortcut/shortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down