EditorManager: Also jump to line if the file is already open

Task-Nr: QTCREATORBUG-2582
This commit is contained in:
dt
2010-10-11 17:04:35 +02:00
parent 2d245f8194
commit fa3bb18346

View File

@@ -1215,8 +1215,12 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
*newEditor = false;
const QList<IEditor *> editors = editorsForFileName(fn);
if (!editors.isEmpty())
return activateEditor(view, editors.first(), flags);
if (!editors.isEmpty()) {
IEditor *editor = editors.first();
if (flags && EditorManager::CanContainLineNumber)
editor->gotoLine(lineNumber, -1);
return activateEditor(view, editor, flags);
}
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
IEditor *editor = createEditor(editorId, fn);