summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp5
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.h1
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp13
3 files changed, 16 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 6b58cc7f85..7141bbf72b 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -1600,6 +1600,11 @@ void EditorManager::updateActions()
m_d->m_openInExternalEditorAction->setEnabled(curEditor != 0);
}
+bool EditorManager::hasSplitter() const
+{
+ return m_d->m_splitter->isSplitter();
+}
+
QList<IEditor*> EditorManager::openedEditors() const
{
return m_d->m_editorModel->editors();
diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h
index 0de53d38c6..a67cb271a8 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.h
+++ b/src/plugins/coreplugin/editormanager/editormanager.h
@@ -155,6 +155,7 @@ public:
QByteArray saveState() const;
bool restoreState(const QByteArray &state);
+ bool hasSplitter() const;
IEditor *restoreEditor(QString fileName, QString editorId, EditorGroup *group);
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index 3ac8659a09..397a997988 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -1007,13 +1007,20 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
void FakeVimPluginPrivate::handleDelayedQuit(bool forced, Core::IEditor *editor)
{
- QList<Core::IEditor *> editors;
- editors.append(editor);
- editorManager()->closeEditors(editors, !forced);
+ // This tries to simulate vim behaviour. But the models of vim and
+ // Qt Creator core do not match well...
+ if (editorManager()->hasSplitter()) {
+ triggerAction(Core::Constants::REMOVE_CURRENT_SPLIT);
+ } else {
+ QList<Core::IEditor *> editors;
+ editors.append(editor);
+ editorManager()->closeEditors(editors, !forced);
+ }
}
void FakeVimPluginPrivate::handleDelayedQuitAll(bool forced)
{
+ triggerAction(Core::Constants::REMOVE_ALL_SPLITS);
editorManager()->closeAllEditors(!forced);
}