diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index b172cec5c22..0f4ce6bed95 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -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]