forked from qt-creator/qt-creator
FakeVim: Change shortcuts from Alt-V,X to Alt-Y,X
Alt-V is taken by the Views menu nowadays. Also, fix the instruction to quit FakeVim on Mac. Fixes: QTCREATORBUG-24694 Change-Id: I5268760f45e34f973b3b38b19d2577c0c655b000 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -4353,10 +4353,15 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input)
|
||||
} else if (input.is('C')) {
|
||||
handleAs("%1c$");
|
||||
} else if (input.isControl('c')) {
|
||||
if (isNoVisualMode())
|
||||
showMessage(MessageInfo, Tr::tr("Type Alt-V, Alt-V to quit FakeVim mode."));
|
||||
else
|
||||
if (isNoVisualMode()) {
|
||||
#if defined(Q_OS_MACOS)
|
||||
showMessage(MessageInfo, Tr::tr("Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode."));
|
||||
#else
|
||||
showMessage(MessageInfo, Tr::tr("Type Alt-Y, Alt-Y to quit FakeVim mode."));
|
||||
#endif
|
||||
} else {
|
||||
leaveVisualMode();
|
||||
}
|
||||
} else if ((input.is('d') || input.is('x') || input.isKey(Key_Delete))
|
||||
&& isVisualMode()) {
|
||||
cutSelectedText();
|
||||
|
||||
@@ -1196,7 +1196,8 @@ bool FakeVimPluginPrivate::initialize()
|
||||
Command *cmd = nullptr;
|
||||
cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim)->action(),
|
||||
INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true);
|
||||
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V")));
|
||||
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+Y,Meta+Shift+Y")
|
||||
: Tr::tr("Alt+Y,Alt+Y")));
|
||||
|
||||
ActionContainer *advancedMenu =
|
||||
ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED);
|
||||
@@ -1207,7 +1208,8 @@ bool FakeVimPluginPrivate::initialize()
|
||||
auto act = new QAction(this);
|
||||
act->setText(Tr::tr("Execute User Action #%1").arg(i));
|
||||
cmd = ActionManager::registerAction(act, base.withSuffix(i));
|
||||
cmd->setDefaultKeySequence(QKeySequence((useMacShortcuts ? Tr::tr("Meta+Shift+V,%1") : Tr::tr("Alt+V,%1")).arg(i)));
|
||||
cmd->setDefaultKeySequence(QKeySequence((useMacShortcuts ? Tr::tr("Meta+Shift+Y,%1")
|
||||
: Tr::tr("Alt+Y,%1")).arg(i)));
|
||||
connect(act, &QAction::triggered, this, [this, i] { userActionTriggered(i); });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user