Commit a4cd9388 authored by Leandro Melo's avatar Leandro Melo
Browse files

C++ tooltip: Display macro tooltip only if hover is actually over the macro name.

parent 72bb7c5c
......@@ -256,12 +256,13 @@ bool CppHoverHandler::matchMacroInUse(const CPlusPlus::Document::Ptr &document,
foreach (const Document::MacroUse &use, document->macroUses()) {
if (use.contains(pos)) {
const Macro& macro = use.macro();
m_toolTip = macro.toString();
return true;
const int begin = use.begin();
const QString &name = use.macro().name();
if (pos < begin + name.length()) {
m_toolTip = use.macro().toString();
m_helpCandidates.append(HelpCandidate(name, name, HelpCandidate::Macro));
return true;
return false;
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