fakevim: Use internal editor widget in tests

Use internal editor with highlighting and folding support for tests to
be able to check folding commands.

Change-Id: Iaab3bc9edb65c8e2a5a7efc4456e021c8a178d7f
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Lukas Holecek
2012-10-08 06:57:32 +02:00
committed by hjk
parent 9f737301b4
commit 49e7ec748e
3 changed files with 173 additions and 40 deletions

View File

@@ -1932,6 +1932,18 @@ void FakeVimPlugin::extensionsInitialized()
addAutoReleasedObject(d->m_statusBar);
}
#ifdef WITH_TESTS
void FakeVimPlugin::setupTest(QString *title, FakeVimHandler **handler, QWidget **edit)
{
*title = QString("test.cpp");
Core::IEditor *iedit = Core::EditorManager::openEditorWithContents(Core::Id(), title);
Core::EditorManager::activateEditor(iedit);
*edit = iedit->widget();
*handler = d->m_editorToHandler.value(iedit, 0);
(*handler)->handleCommand("set startofline");
}
#endif
} // namespace Internal
} // namespace FakeVim