forked from qt-creator/qt-creator
Locator: Add highlighting of the search text
Change-Id: Ia166e9667076e46770a754b626ceb28080139e79 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -65,10 +65,12 @@ void CMakeLocatorFilter::prepareSearch(const QString &entry)
|
||||
if (!cmakeProject)
|
||||
continue;
|
||||
foreach (const QString &title, cmakeProject->buildTargetTitles()) {
|
||||
if (title.contains(entry)) {
|
||||
Core::LocatorFilterEntry entry(this, title, cmakeProject->projectFilePath().toString());
|
||||
entry.extraInfo = FileUtils::shortNativePath(cmakeProject->projectFilePath());
|
||||
m_result.append(entry);
|
||||
const int index = title.indexOf(entry);
|
||||
if (index >= 0) {
|
||||
Core::LocatorFilterEntry filterEntry(this, title, cmakeProject->projectFilePath().toString());
|
||||
filterEntry.extraInfo = FileUtils::shortNativePath(cmakeProject->projectFilePath());
|
||||
filterEntry.highlightInfo = {index, entry.length()};
|
||||
m_result.append(filterEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user