GitGrep: fixed substitution of regexp

Task-number: QTCREATORBUG-17193
Change-Id: I7e11a5a55f373dce98a9e203bb3bcb5e929174fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Przemyslaw Gorszkowski
2016-11-02 08:55:55 +01:00
parent 9b0b6aad2e
commit 39d85833b5

View File

@@ -112,6 +112,15 @@ public:
+ text.mid(matchEnd + resetColor.size());
}
single.matchingLine = text;
if (m_parameters.flags & FindRegularExpression) {
const QRegularExpression::PatternOptions patternOptions =
(m_parameters.flags & QTextDocument::FindCaseSensitively)
? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption;
QRegularExpression regexp(m_parameters.text, patternOptions);
QRegularExpressionMatch regexpMatch = regexp.match(line);
single.regexpCapturedTexts = regexpMatch.capturedTexts();
}
foreach (auto match, matches) {
single.matchStart = match.first;
single.matchLength = match.second;