From 8339de66d2472299281b8542e1254575f316ddf6 Mon Sep 17 00:00:00 2001 From: Scott Sumner <30118311+sasumner@users.noreply.github.com> Date: Tue, 27 Apr 2021 16:31:16 -0400 Subject: [PATCH] Remove obsolete logic with wholeword and MarkAll Fix #9803, close #9810 --- PowerEditor/src/NppCommands.cpp | 4 ++-- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 8 ++------ PowerEditor/src/ScintillaComponent/FindReplaceDlg.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 8b2376fe1..60ab60883 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1267,12 +1267,12 @@ void Notepad_plus::command(int id) { if (lstrlen(wordOnCaret) > 0) { - _findReplaceDlg.markAll(wordOnCaret, styleID, true); + _findReplaceDlg.markAll(wordOnCaret, styleID); } } else { - _findReplaceDlg.markAll(selectedText, styleID, lstrlen(selectedText) == lstrlen(wordOnCaret)); + _findReplaceDlg.markAll(selectedText, styleID); } } break; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index a1bbd76a2..48e84f17c 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -2062,17 +2062,13 @@ bool FindReplaceDlg::processReplace(const TCHAR *txt2find, const TCHAR *txt2repl -int FindReplaceDlg::markAll(const TCHAR *txt2find, int styleID, bool isWholeWordSelected) +int FindReplaceDlg::markAll(const TCHAR *txt2find, int styleID) { const NppGUI& nppGUI = NppParameters::getInstance().getNppGUI(); FindOption markAllOpt; markAllOpt._isMatchCase = nppGUI._markAllCaseSensitive; - - // if whole word is selected for being colorized, isWholeWord setting in Preferences will be checked - // otherwise this option is false, because user may want to find the words contain the parts to search - markAllOpt._isWholeWord = isWholeWordSelected ? nppGUI._markAllWordOnly : false; - + markAllOpt._isWholeWord = nppGUI._markAllWordOnly; markAllOpt._str2Search = txt2find; int nbFound = processAll(ProcessMarkAllExt, &markAllOpt, true, NULL, styleID); diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index 15b4e06b6..f89ada393 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -249,7 +249,7 @@ public : bool processFindNext(const TCHAR *txt2find, const FindOption *options = NULL, FindStatus *oFindStatus = NULL, FindNextType findNextType = FINDNEXTTYPE_FINDNEXT); bool processReplace(const TCHAR *txt2find, const TCHAR *txt2replace, const FindOption *options = NULL); - int markAll(const TCHAR *txt2find, int styleID, bool isWholeWordSelected); + int markAll(const TCHAR *txt2find, int styleID); int markAllInc(const FindOption *opt);