aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitgrep.cpp
diff options
context:
space:
mode:
authorPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2016-11-02 08:55:55 +0100
committerPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2016-11-03 10:35:59 +0000
commit39d85833b5bfc11fd23f2405efe4645994ff9c02 (patch)
treebee83c96369748992aad06867dcd0fd1bb8e00ae /src/plugins/git/gitgrep.cpp
parent9b0b6aad2e5f72e06ebd8537040edf6daade04d1 (diff)
GitGrep: fixed substitution of regexp
Task-number: QTCREATORBUG-17193 Change-Id: I7e11a5a55f373dce98a9e203bb3bcb5e929174fc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git/gitgrep.cpp')
-rw-r--r--src/plugins/git/gitgrep.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index 496e6c3490c..05060f413ba 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -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;