forked from qt-creator/qt-creator
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:
@@ -625,11 +625,6 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
|
|||||||
QTextBlock block;
|
QTextBlock block;
|
||||||
const SimpleToken tk = tokenUnderCursor(tc, &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))
|
if (tk.isNot(T_IDENTIFIER))
|
||||||
return link;
|
return link;
|
||||||
|
|
||||||
@@ -668,7 +663,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
|
|||||||
def = findDefinition(symbol);
|
def = findDefinition(symbol);
|
||||||
|
|
||||||
link = linkToSymbol(def ? def : symbol);
|
link = linkToSymbol(def ? def : symbol);
|
||||||
link.pos = nameStart;
|
link.pos = block.position() + nameStart;
|
||||||
link.length = nameLength;
|
link.length = nameLength;
|
||||||
return link;
|
return link;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user