From 3b0479309729cbcdd29fa2a458b9b3e842543312 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 18 Jun 2022 18:10:04 +0200 Subject: [PATCH] Fix Find in files performance regression since updating Scintilla 5 It's due to the folding the previous result before the begin of search. For the unknown reason there's performance issue if folding action is at this place for Scintilla 5. Fix #11814 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 00352fae4..e2ac64894 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -2300,7 +2300,6 @@ int FindReplaceDlg::processAll(ProcessOperation op, const FindOption *opt, bool enableFindDlgItem(IDC_IN_SELECTION_CHECK, false); } } - return nbProcessed; } @@ -2462,7 +2461,6 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl srm._start = static_cast(start_mark); srm._end = static_cast(end_mark); _pFinder->add(FoundInfo(targetStart, targetEnd, lineNumber + 1, pFileName), srm, line.c_str(), totalLineNumber); - break; } @@ -2710,7 +2708,6 @@ void FindReplaceDlg::findAllIn(InWhat op) justCreated = true; } _pFinder->setFinderStyle(); - if (_pFinder->_purgeBeforeEverySearch) { _pFinder->removeAll(); @@ -2742,7 +2739,6 @@ void FindReplaceDlg::findAllIn(InWhat op) if (!cmdid) return; bool limitSearchScopeToSelection = op == CURR_DOC_SELECTION; - if (::SendMessage(_hParent, cmdid, static_cast(limitSearchScopeToSelection ? 1 : 0), 0)) { generic_string text = _pFinder->getHitsString(_findAllResult); @@ -4274,7 +4270,8 @@ void Finder::beginNewFilesSearch() _nbFoundFiles = 0; // fold all old searches (1st level only) - _scintView.collapse(searchHeaderLevel - SC_FOLDLEVELBASE, fold_collapse); + // 2022/06/18: Due to performance issue on Scintilla 5.x, the following line is commented: + //_scintView.collapse(searchHeaderLevel - SC_FOLDLEVELBASE, fold_collapse); } void Finder::finishFilesSearch(int count, int searchedCount, bool isMatchLines, bool searchedEntireNotSelection)