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
pull/11821/head
Don Ho 2022-06-18 18:10:04 +02:00
parent f1ed4de78d
commit 3b04793097
1 changed files with 2 additions and 5 deletions

View File

@ -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<long>(start_mark);
srm._end = static_cast<long>(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<WPARAM>(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)