FakeVim: Focus current editor before handling command line command

Action like "Switch Header/Source" need to be performed in correct
context, in this case "CppEditor.C++Editor". But while command line is
focused the context is global.

Task-number: QTCREATORBUG-9217
Change-Id: I8680e7d9612e72d23e1ef6515904941505f410d8
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
hluk
2013-04-26 18:07:04 +02:00
committed by hjk
parent 8371a83dda
commit 70a5d125f9

View File

@@ -1719,6 +1719,11 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
if (!handler)
return;
// Focus editor first so actions can be executed in correct context.
QWidget *editor = handler->widget();
if (editor)
editor->setFocus();
*handled = true;
if (cmd.matches(_("w"), _("write")) || cmd.cmd == _("wq")) {
// :w[rite]