From 494f0764dcf728d57364bb000f83e8bbf694a6f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Mon, 6 Apr 2009 15:28:25 +0200
Subject: [PATCH] Fix the navigation links on Ctrl-hover

Link position had the wrong offset. Also took out a redundant check on
token kind.
---
 src/plugins/cppeditor/cppeditor.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 1593b6118c2..c36e78b4002 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -625,11 +625,6 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
     QTextBlock block;
     const SimpleToken tk = tokenUnderCursor(tc, &block);
 
-    if (tk.isLiteral() || tk.isComment()) {
-        // Drop out if we're at a number, string or comment
-        return link;
-    }
-
     if (tk.isNot(T_IDENTIFIER))
         return link;
 
@@ -668,7 +663,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
                 def = findDefinition(symbol);
 
             link = linkToSymbol(def ? def : symbol);
-            link.pos = nameStart;
+            link.pos = block.position() + nameStart;
             link.length = nameLength;
             return link;
 
-- 
GitLab