From fa3bb18346bbddc2a41b427ef44d71eaef962ec7 Mon Sep 17 00:00:00 2001
From: dt <qtc-committer@nokia.com>
Date: Mon, 11 Oct 2010 17:04:35 +0200
Subject: [PATCH] EditorManager: Also jump to line if the file is already open

Task-Nr: QTCREATORBUG-2582
---
 src/plugins/coreplugin/editormanager/editormanager.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 76912be7727..a3bce5276fe 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -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);
-- 
GitLab