aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-10-05 10:18:44 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-10-05 15:47:13 +0000
commit62d971b30ba19053eb5944b8dca8e4c587a62181 (patch)
treebeaa970a11404fe0f0e497f63a1dda14cb389e3e /src/plugins/cpptools/cppcurrentdocumentfilter.cpp
parent4d3ea43dbc896033202f105975257f4a1f3b5ada (diff)
Locator: De-duplicate highlightInfo generation for camel humps
Change-Id: I5a3fd28ddd68b2ac17a76384cffad12064d06259 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppcurrentdocumentfilter.cpp')
-rw-r--r--src/plugins/cpptools/cppcurrentdocumentfilter.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
index 440e53439f..bae78edce6 100644
--- a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
+++ b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp
@@ -30,7 +30,6 @@
#include <coreplugin/idocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
-#include <utils/camelhumpmatcher.h>
#include <QRegularExpression>
@@ -96,14 +95,13 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(
Core::LocatorFilterEntry filterEntry(this, name, id, info->icon());
filterEntry.extraInfo = extraInfo;
- if (!match.hasMatch()) {
+ if (match.hasMatch()) {
+ filterEntry.highlightInfo = highlightInfo(match);
+ } else {
match = regexp.match(extraInfo);
- filterEntry.highlightInfo.dataType = Core::LocatorFilterEntry::HighlightInfo::ExtraInfo;
+ filterEntry.highlightInfo =
+ highlightInfo(match, Core::LocatorFilterEntry::HighlightInfo::ExtraInfo);
}
- const CamelHumpMatcher::HighlightingPositions positions =
- CamelHumpMatcher::highlightingPositions(match);
- filterEntry.highlightInfo.starts = positions.starts;
- filterEntry.highlightInfo.lengths = positions.lengths;
if (betterMatch)
betterEntries.append(filterEntry);