diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp
index b602333684795ce4edf14903b203c7ad9dd0dfce..c4eafb99de53340c298e6abb98d1431e074d51a7 100644
--- a/src/plugins/classview/classviewmanager.cpp
+++ b/src/plugins/classview/classviewmanager.cpp
@@ -297,7 +297,9 @@ void Manager::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
 void Manager::gotoLocation(const QString &fileName, int line, int column)
 {
     bool newEditor = false;
-    TextEditor::BaseTextEditor::openEditorAt(fileName, line, column, QString(), &newEditor);
+    TextEditor::BaseTextEditor::openEditorAt(fileName, line, column, QString(),
+                                             Core::EditorManager::IgnoreNavigationHistory,
+                                             &newEditor);
 }
 
 void Manager::gotoLocations(const QList<QVariant> &list)
diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp
index 802513df07a1366d2128c6b1b5ddc2297fde26c4..fdecd39f3429b38373ac64457b61243af29c4ffd 100644
--- a/src/plugins/coreplugin/basefilewizard.cpp
+++ b/src/plugins/coreplugin/basefilewizard.cpp
@@ -48,6 +48,7 @@
 #include <QtCore/QSharedData>
 #include <QtCore/QEventLoop>
 #include <QtCore/QSharedPointer>
+#include <QtCore/QScopedPointer>
 
 #include <QtGui/QMessageBox>
 #include <QtGui/QWizard>
@@ -506,7 +507,9 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
     // Create dialog and run it. Ensure that the dialog is deleted when
     // leaving the func, but not before the IFileWizardExtension::process
     // has been called
-    const QSharedPointer<QWizard> wizard(createWizardDialog(parent, path, allExtensionPages));
+    const QScopedPointer<QWizard> wizard(createWizardDialog(parent, path, allExtensionPages));
+    QTC_ASSERT(!wizard.isNull(), return QStringList())
+
     GeneratedFiles files;
     // Run the wizard: Call generate files on switching to the first extension
     // page is OR after 'Accepted' if there are no extension pages
diff --git a/src/plugins/debugger/debuggeragents.cpp b/src/plugins/debugger/debuggeragents.cpp
index 0442d17229c1dbaf54d09f9561b339a622a6a64d..4bc623496e8f1e8dbef55b25455c6d5b255bebb3 100644
--- a/src/plugins/debugger/debuggeragents.cpp
+++ b/src/plugins/debugger/debuggeragents.cpp
@@ -123,7 +123,7 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
         connect(editor->widget(), SIGNAL(endOfFileRequested(Core::IEditor *)),
             this, SLOT(handleEndOfFileRequested(Core::IEditor*)));
         m_editors << editor;
-        editorManager->activateEditor(editor);
+        editorManager->activateEditor(editor, Core::EditorManager::NoModeSwitch);
         QMetaObject::invokeMethod(editor->widget(), "setNewWindowRequestAllowed");
         QMetaObject::invokeMethod(editor->widget(), "setLazyData",
             Q_ARG(quint64, addr), Q_ARG(int, DataRange), Q_ARG(int, BinBlockSize));
@@ -147,7 +147,7 @@ void MemoryViewAgent::addLazyData(QObject *editorToken, quint64 addr,
 {
     Core::IEditor *editor = qobject_cast<Core::IEditor *>(editorToken);
     if (editor && editor->widget()) {
-        Core::EditorManager::instance()->activateEditor(editor);
+        Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::NoModeSwitch);
         QMetaObject::invokeMethod(editor->widget(), "addLazyData",
             Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
     }
@@ -343,7 +343,7 @@ void DisassemblerViewAgent::setContents(const QString &contents)
         d->configureMimeType();
     }
 
-    editorManager->activateEditor(d->editor);
+    editorManager->activateEditor(d->editor, Core::EditorManager::NoModeSwitch);
 
     plainTextEdit = qobject_cast<QPlainTextEdit *>(d->editor->widget());
     if (plainTextEdit) {
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index e72e48090c97b49c60296538815589a1ceeb3809..1729a4c861bfcb9ba67f8ff08d7e31adc0a30e9c 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2345,7 +2345,9 @@ void DebuggerPluginPrivate::gotoLocation(const QString &file, int line, bool set
 {
     bool newEditor = false;
     ITextEditor *editor =
-        BaseTextEditor::openEditorAt(file, line, 0, QString(), &newEditor);
+        BaseTextEditor::openEditorAt(file, line, 0, QString(),
+                                     Core::EditorManager::IgnoreNavigationHistory,
+                                     &newEditor);
     if (!editor)
         return;
     if (newEditor)
@@ -2575,7 +2577,9 @@ void DebuggerPlugin::gotoLocation(const QString &file, int line, bool setMarker)
 {
     bool newEditor = false;
     ITextEditor *editor =
-        BaseTextEditor::openEditorAt(file, line, 0, QString(), &newEditor);
+        BaseTextEditor::openEditorAt(file, line, 0, QString(),
+                                     Core::EditorManager::IgnoreNavigationHistory|Core::EditorManager::NoModeSwitch,
+                                     &newEditor);
     if (!editor)
         return;
     if (newEditor)
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index c4c411b4b98208e8a677e77f637fb15f14fc80e7..647f16206d74c189c6304625ae748ee3cb4756c4 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -140,18 +140,16 @@ protected:
 } // namespace Internal
 } // namespace TextEditor
 
-
-ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName,
-                                          int line,
-                                          int column,
-                                          const QString &editorKind,
-                                          bool *newEditor)
+ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName, int line, int column,
+                                 const QString &editorKind,
+                                 Core::EditorManager::OpenEditorFlags flags,
+                                 bool *newEditor)
 {
     Core::EditorManager *editorManager = Core::EditorManager::instance();
     editorManager->cutForwardNavigationHistory();
     editorManager->addCurrentPositionToNavigationHistory();
     Core::IEditor *editor = editorManager->openEditor(fileName, editorKind,
-            Core::EditorManager::IgnoreNavigationHistory, newEditor);
+            flags, newEditor);
     TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor);
     if (texteditor) {
         texteditor->gotoLine(line, column);
diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h
index 121ba012cde48dc6c227b2ce21c3b3d5eb6577a5..176350502fdf625c87426a863da92cdbd629ef8b 100644
--- a/src/plugins/texteditor/basetexteditor.h
+++ b/src/plugins/texteditor/basetexteditor.h
@@ -34,6 +34,8 @@
 
 #include <find/ifindsupport.h>
 
+#include <coreplugin/editormanager/editormanager.h>
+
 #include <QtGui/QPlainTextEdit>
 
 QT_BEGIN_NAMESPACE
@@ -141,7 +143,8 @@ public:
     ~BaseTextEditor();
 
     static ITextEditor *openEditorAt(const QString &fileName, int line, int column = 0,
-                                     const QString &editorId = QString(),
+                                     const QString &editorId =  QString(),
+                                     Core::EditorManager::OpenEditorFlags flags = Core::EditorManager::IgnoreNavigationHistory,
                                      bool *newEditor = 0);
 
     const Utils::ChangeSet &changeSet() const;