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
This commit is contained in:
Don Ho 2022-06-18 18:10:04 +02:00
parent f1ed4de78d
commit 3b04793097

View File

@ -2300,7 +2300,6 @@ int FindReplaceDlg::processAll(ProcessOperation op, const FindOption *opt, bool
enableFindDlgItem(IDC_IN_SELECTION_CHECK, false); enableFindDlgItem(IDC_IN_SELECTION_CHECK, false);
} }
} }
return nbProcessed; return nbProcessed;
} }
@ -2462,7 +2461,6 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl
srm._start = static_cast<long>(start_mark); srm._start = static_cast<long>(start_mark);
srm._end = static_cast<long>(end_mark); srm._end = static_cast<long>(end_mark);
_pFinder->add(FoundInfo(targetStart, targetEnd, lineNumber + 1, pFileName), srm, line.c_str(), totalLineNumber); _pFinder->add(FoundInfo(targetStart, targetEnd, lineNumber + 1, pFileName), srm, line.c_str(), totalLineNumber);
break; break;
} }
@ -2710,7 +2708,6 @@ void FindReplaceDlg::findAllIn(InWhat op)
justCreated = true; justCreated = true;
} }
_pFinder->setFinderStyle(); _pFinder->setFinderStyle();
if (_pFinder->_purgeBeforeEverySearch) if (_pFinder->_purgeBeforeEverySearch)
{ {
_pFinder->removeAll(); _pFinder->removeAll();
@ -2742,7 +2739,6 @@ void FindReplaceDlg::findAllIn(InWhat op)
if (!cmdid) return; if (!cmdid) return;
bool limitSearchScopeToSelection = op == CURR_DOC_SELECTION; bool limitSearchScopeToSelection = op == CURR_DOC_SELECTION;
if (::SendMessage(_hParent, cmdid, static_cast<WPARAM>(limitSearchScopeToSelection ? 1 : 0), 0)) if (::SendMessage(_hParent, cmdid, static_cast<WPARAM>(limitSearchScopeToSelection ? 1 : 0), 0))
{ {
generic_string text = _pFinder->getHitsString(_findAllResult); generic_string text = _pFinder->getHitsString(_findAllResult);
@ -4274,7 +4270,8 @@ void Finder::beginNewFilesSearch()
_nbFoundFiles = 0; _nbFoundFiles = 0;
// fold all old searches (1st level only) // 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) void Finder::finishFilesSearch(int count, int searchedCount, bool isMatchLines, bool searchedEntireNotSelection)