Fix the navigation links on Ctrl-hover

Link position had the wrong offset. Also took out a redundant check on
token kind.
This commit is contained in:
Thorbjørn Lindeijer
2009-04-06 15:28:25 +02:00
parent 733fb8fb62
commit 494f0764dc

View File

@@ -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;