Jump to the declaration if the last visible symbol is the current function definition.

This commit is contained in:
Roberto Raggi
2010-05-14 15:33:01 +02:00
parent 25b04ff5b4
commit 3decf8ccc0

View File

@@ -1348,9 +1348,13 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if (Symbol *symbol = result.declaration()) {
Symbol *def = 0;
if (resolveTarget)
if (resolveTarget) {
def = findDefinition(symbol, snapshot);
if (def == doc->findSymbolAt(line, column))
def = 0; // jump to declaration then.
}
link = linkToSymbol(def ? def : symbol);
link.begin = beginOfToken;
link.end = endOfToken;