TextEditor: Fix search result highlight for overlapping results

Fixes: QTCREATORBUG-25237
Change-Id: Ib95e49b4db57909b79295f2ff7729560ab45c8a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-01-15 09:43:12 +01:00
parent d8acff46ff
commit 8526c7de77

View File

@@ -3680,7 +3680,7 @@ void TextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, co
.toTextCharFormat(C_SEARCH_RESULT).background().color().darker(120); .toTextCharFormat(C_SEARCH_RESULT).background().color().darker(120);
while (idx < text.length()) { while (idx < text.length()) {
const QRegularExpressionMatch match = m_searchExpr.match(text, idx + 1); const QRegularExpressionMatch match = m_searchExpr.match(text, idx + l + 1);
if (!match.hasMatch()) if (!match.hasMatch())
break; break;
idx = match.capturedStart(); idx = match.capturedStart();