Commit 04679f80 authored by Andre Hartmann's avatar Andre Hartmann Committed by Leandro Melo
Browse files

Improved highlighting in C++ Macro Usages.

Only highlight the Macro name, not the whole definition line
or the parameter list in function-like Macros.

Change-Id: I5732dd5dd18cee150755ea35a5fbb67fdaed51c4
Reviewed-by: default avatarFrancois Ferrand <>
Reviewed-by: default avatarOrgad Shaneh <>
Reviewed-by: default avatarLeandro Melo <>
parent 2176599e
......@@ -560,7 +560,7 @@ public:
unsigned lineStart;
const QString &lineSource = matchingLine(use.begin(), source, &lineStart);
usages.append(Usage(fileName, lineSource, use.beginLine(),
use.begin() - lineStart, use.length()));
use.begin() - lineStart,;
......@@ -644,8 +644,9 @@ void CppFindReferences::findMacroUses(const Macro &macro)
// ### FIXME: Encoding?
const QByteArray &source = getSource(macro.fileName(), workingCopy).toLatin1();
search->addResult(macro.fileName(), macro.line(),
source.mid(macro.offset(), macro.length()), 0, macro.length());
const QByteArray line = source.mid(macro.offset(), macro.length());
search->addResult(macro.fileName(), macro.line(), line,
QFuture<Usage> result;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment