forked from qt-creator/qt-creator
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user