diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 51cec16c322..3b130c5120a 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1490,8 +1490,13 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName, IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId, OpenEditorFlags flags, bool *newEditor) { - if (flags & EditorManager::OpenInOtherSplit) - m_instance->gotoOtherSplit(); + if (flags & EditorManager::OpenInOtherSplit) { + if (flags & EditorManager::NoNewSplits) + m_instance->gotoNextSplit(); + else + m_instance->gotoOtherSplit(); + } + return m_instance->openEditor(m_instance->currentEditorView(), fileName, editorId, flags, newEditor); } @@ -1663,8 +1668,12 @@ IEditor *EditorManager::openEditorWithContents(const Id &editorId, if (debugEditorManager) qDebug() << Q_FUNC_INFO << editorId.name() << titlePattern << contents; - if (flags & EditorManager::OpenInOtherSplit) - m_instance->gotoOtherSplit(); + if (flags & EditorManager::OpenInOtherSplit) { + if (flags & EditorManager::NoNewSplits) + m_instance->gotoNextSplit(); + else + m_instance->gotoOtherSplit(); + } QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index d84f4caa2ea..fdae4ea1e6e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -103,7 +103,8 @@ public: IgnoreNavigationHistory = 2, DoNotMakeVisible = 4, CanContainLineNumber = 8, - OpenInOtherSplit = 16 + OpenInOtherSplit = 16, + NoNewSplits = 32 }; Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)