From 8526c7de77834fb382976fae13eceedc69ede02b Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 15 Jan 2021 09:43:12 +0100 Subject: [PATCH] TextEditor: Fix search result highlight for overlapping results Fixes: QTCREATORBUG-25237 Change-Id: Ib95e49b4db57909b79295f2ff7729560ab45c8a9 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 927cf294af3..a1e8dfa8f03 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -3680,7 +3680,7 @@ void TextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, co .toTextCharFormat(C_SEARCH_RESULT).background().color().darker(120); 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()) break; idx = match.capturedStart();