CppEditor: Follow Symbol Under Cursor opens the preprocessor dialog

... when invoked on a macro that is defined inside that dialog.

Change-Id: I419c6675d70cfb8dd174f6a33f502b4c584baa3a
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-10-21 12:59:48 +02:00
parent f5fa022de5
commit e79d4ed2e1
4 changed files with 14 additions and 5 deletions

View File

@@ -454,16 +454,18 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
const QByteArray name = CPPEditorWidget::identifierUnderCursor(&macroCursor).toLatin1();
if (macro->name() == name)
return link; //already on definition!
} else {
const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1);
if (use && use->macro().fileName() != CppModelManagerInterface::configurationFileName()) {
} else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) {
const QString fileName = use->macro().fileName();
if (fileName == CppModelManagerInterface::editorConfigurationFileName()) {
m_widget->showPreProcessorWidget();
} else if (fileName != CppModelManagerInterface::configurationFileName()) {
const Macro &macro = use->macro();
link.targetFileName = macro.fileName();
link.targetLine = macro.line();
link.linkTextStart = use->begin();
link.linkTextEnd = use->end();
return link;
}
return link;
}
// Find the last symbol up to the cursor position