FakeVim: Force leaving input mode when switching editors

Change-Id: I9c871cf7b0cba027b8a0ec201dd57f1039c9f4a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2016-12-09 10:10:31 +01:00
committed by Eike Ziller
parent 52803f168b
commit 4721888fa7
5 changed files with 19 additions and 0 deletions

View File

@@ -1035,6 +1035,7 @@ private:
void onCoreAboutToClose();
void editorOpened(Core::IEditor *);
void editorAboutToClose(Core::IEditor *);
void currentEditorAboutToChange(Core::IEditor *);
void allDocumentsRenamed(const QString &oldName, const QString &newName);
void documentRenamed(Core::IDocument *document, const QString &oldName, const QString &newName);
@@ -1246,6 +1247,8 @@ bool FakeVimPluginPrivate::initialize()
this, &FakeVimPluginPrivate::editorAboutToClose);
connect(EditorManager::instance(), &EditorManager::editorOpened,
this, &FakeVimPluginPrivate::editorOpened);
connect(EditorManager::instance(), &EditorManager::currentEditorAboutToChange,
this, &FakeVimPluginPrivate::currentEditorAboutToChange);
connect(DocumentManager::instance(), &DocumentManager::allDocumentsRenamed,
this, &FakeVimPluginPrivate::allDocumentsRenamed);
@@ -1841,6 +1844,12 @@ void FakeVimPluginPrivate::editorAboutToClose(IEditor *editor)
m_editorToHandler.remove(editor);
}
void FakeVimPluginPrivate::currentEditorAboutToChange(IEditor *editor)
{
if (FakeVimHandler *handler = m_editorToHandler.value(editor, 0))
handler->enterCommandMode();
}
void FakeVimPluginPrivate::allDocumentsRenamed(const QString &oldName, const QString &newName)
{
renameFileNameInEditors(oldName, newName);