Commit 3decf8cc authored by Roberto Raggi's avatar Roberto Raggi
Browse files

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

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