From 13f0717a1b652d05af42826c5d2ce4e198b71369 Mon Sep 17 00:00:00 2001 From: Scott Sumner <30118311+sasumner@users.noreply.github.com> Date: Tue, 24 Mar 2020 20:28:28 -0400 Subject: [PATCH] Improve compatibility for IDC_FINDNEXT and IDC_FINDPREV macros Close #8064, close #8065 --- .../src/ScitillaComponent/FindReplaceDlg.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index f3cd2a50..b03b4f96 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2660,14 +2660,30 @@ void FindReplaceDlg::execSavedCommand(int cmd, uptr_t intValue, const generic_st NppParameters& nppParamInst = NppParameters::getInstance(); switch (intValue) { - case IDC_FINDNEXT: // retro-compatible to 7.8.4 and older versions - case IDC_FINDPREV: // retro-compatible to 7.8.4 and older versions case IDOK: nppParamInst._isFindReplacing = true; processFindNext(_env->_str2Search.c_str()); nppParamInst._isFindReplacing = false; break; + case IDC_FINDNEXT: + // IDC_FINDNEXT will not be recorded into new macros recorded with 7.8.5 and later + // stay playback compatible with 7.5.5 - 7.8.4 where IDC_FINDNEXT was allowed but unneeded/undocumented + nppParamInst._isFindReplacing = true; + _env->_whichDirection = DIR_DOWN; + processFindNext(_env->_str2Search.c_str()); + nppParamInst._isFindReplacing = false; + break; + + case IDC_FINDPREV: + // IDC_FINDPREV will not be recorded into new macros recorded with 7.8.5 and later + // stay playback compatible with 7.5.5 - 7.8.4 where IDC_FINDPREV was allowed but unneeded/undocumented + nppParamInst._isFindReplacing = true; + _env->_whichDirection = DIR_UP; + processFindNext(_env->_str2Search.c_str()); + nppParamInst._isFindReplacing = false; + break; + case IDREPLACE: nppParamInst._isFindReplacing = true; processReplace(_env->_str2Search.c_str(), _env->_str4Replace.c_str(), _env);