forked from qt-creator/qt-creator
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user