forked from qt-creator/qt-creator
Locator: De-duplicate highlightInfo generation for camel humps
Change-Id: I5a3fd28ddd68b2ac17a76384cffad12064d06259 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
4d3ea43dbc
commit
62d971b30b
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/camelhumpmatcher.h>
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
@@ -82,11 +81,8 @@ QList<Core::LocatorFilterEntry> FunctionFilter::matchesFor(
|
||||
if (match.hasMatch()) {
|
||||
QVariant id = qVariantFromValue(info);
|
||||
Core::LocatorFilterEntry filterEntry(this, info.displayName, id/*, info.icon*/);
|
||||
const CamelHumpMatcher::HighlightingPositions positions =
|
||||
CamelHumpMatcher::highlightingPositions(match);
|
||||
filterEntry.extraInfo = info.extraInfo;
|
||||
filterEntry.highlightInfo.starts = positions.starts;
|
||||
filterEntry.highlightInfo.lengths = positions.lengths;
|
||||
filterEntry.highlightInfo = highlightInfo(match);
|
||||
|
||||
if (filterEntry.displayName.startsWith(entry, caseSensitivityForPrefix))
|
||||
bestEntries.append(filterEntry);
|
||||
|
||||
Reference in New Issue
Block a user