diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index cc81ff5c9..a30cc7108 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1287,22 +1287,34 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA return TRUE; case IDM_SEARCH_FIND: - enableReplaceFunc(false); // enable relace false so only find + if (_currentStatus == FIND_DLG) + goToCenter(); + else + enableReplaceFunc(false); return TRUE; case IDM_SEARCH_REPLACE: - enableReplaceFunc(true); + if (_currentStatus == REPLACE_DLG) + goToCenter(); + else + enableReplaceFunc(true); return TRUE; case IDM_SEARCH_FINDINFILES: - enableFindInFilesFunc(); + if (_currentStatus == FINDINFILES_DLG) + goToCenter(); + else + enableFindInFilesFunc(); return TRUE; case IDM_SEARCH_MARK: - enableMarkFunc(); + if (_currentStatus == MARK_DLG) + goToCenter(); + else + enableMarkFunc(); return TRUE; - case IDREPLACE : + case IDREPLACE: { std::lock_guard lock(findOps_mutex);