C++: Jump to better location when function signature is updated.

This will allow using 'Follow Symbol' to jump back after the change.

Change-Id: I99fd3ebc63a2af58b12eee9d7055a4c2f249e97d
Reviewed-on: http://codereview.qt.nokia.com/4186
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-05 12:03:47 +02:00
parent e99f915623
commit 465890ac31

View File

@@ -300,8 +300,10 @@ void FunctionDeclDefLink::apply(CPPEditorWidget *editor, bool jumpToMatch)
if (targetInitial == newTargetFile->textOf(targetStart, targetEnd)) {
const Utils::ChangeSet changeset = changes(snapshot, targetStart);
newTargetFile->setChangeSet(changeset);
if (jumpToMatch)
newTargetFile->setOpenEditor(true, targetStart);
if (jumpToMatch) {
const int jumpTarget = newTargetFile->position(targetFunction->line(), targetFunction->column());
newTargetFile->setOpenEditor(true, jumpTarget);
}
newTargetFile->apply();
} else {
TextEditor::ToolTip::instance()->show(