forked from qt-creator/qt-creator
FakeVim: Fix gt/gT/:tabnext/:tabprevious
The mapping was there, but not connected to the core actions. Change-Id: I9faa1c47afe409caaa0462740a6865d99d959b44 Reviewed-by: Lukas Holecek <hluk@email.cz> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -2141,6 +2141,8 @@ public:
|
|||||||
bool handleExShiftCommand(const ExCommand &cmd);
|
bool handleExShiftCommand(const ExCommand &cmd);
|
||||||
bool handleExSourceCommand(const ExCommand &cmd);
|
bool handleExSourceCommand(const ExCommand &cmd);
|
||||||
bool handleExSubstituteCommand(const ExCommand &cmd);
|
bool handleExSubstituteCommand(const ExCommand &cmd);
|
||||||
|
bool handleExTabNextCommand(const ExCommand &cmd);
|
||||||
|
bool handleExTabPreviousCommand(const ExCommand &cmd);
|
||||||
bool handleExWriteCommand(const ExCommand &cmd);
|
bool handleExWriteCommand(const ExCommand &cmd);
|
||||||
bool handleExEchoCommand(const ExCommand &cmd);
|
bool handleExEchoCommand(const ExCommand &cmd);
|
||||||
|
|
||||||
@@ -5561,6 +5563,24 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FakeVimHandler::Private::handleExTabNextCommand(const ExCommand &cmd)
|
||||||
|
{
|
||||||
|
if (cmd.cmd != "tabnext" && cmd.cmd != "tabn")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
emit q->tabNextRequested(q);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FakeVimHandler::Private::handleExTabPreviousCommand(const ExCommand &cmd)
|
||||||
|
{
|
||||||
|
if (cmd.cmd != "tabprevious" && cmd.cmd != "tabp")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
emit q->tabPreviousRequested(q);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool FakeVimHandler::Private::handleExMapCommand(const ExCommand &cmd0) // :map
|
bool FakeVimHandler::Private::handleExMapCommand(const ExCommand &cmd0) // :map
|
||||||
{
|
{
|
||||||
QByteArray modes;
|
QByteArray modes;
|
||||||
@@ -6212,6 +6232,8 @@ bool FakeVimHandler::Private::handleExCommandHelper(ExCommand &cmd)
|
|||||||
|| handleExShiftCommand(cmd)
|
|| handleExShiftCommand(cmd)
|
||||||
|| handleExSourceCommand(cmd)
|
|| handleExSourceCommand(cmd)
|
||||||
|| handleExSubstituteCommand(cmd)
|
|| handleExSubstituteCommand(cmd)
|
||||||
|
|| handleExTabNextCommand(cmd)
|
||||||
|
|| handleExTabPreviousCommand(cmd)
|
||||||
|| handleExWriteCommand(cmd)
|
|| handleExWriteCommand(cmd)
|
||||||
|| handleExEchoCommand(cmd);
|
|| handleExEchoCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,8 @@ signals:
|
|||||||
void fold(FakeVimHandler *self, int depth, bool fold);
|
void fold(FakeVimHandler *self, int depth, bool fold);
|
||||||
void foldGoTo(FakeVimHandler *self, int count, bool current);
|
void foldGoTo(FakeVimHandler *self, int count, bool current);
|
||||||
void jumpToGlobalMark(FakeVimHandler *handler, QChar mark, bool backTickMode, const QString &fileName);
|
void jumpToGlobalMark(FakeVimHandler *handler, QChar mark, bool backTickMode, const QString &fileName);
|
||||||
|
void tabNextRequested(FakeVimHandler *self);
|
||||||
|
void tabPreviousRequested(FakeVimHandler *self);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class Private;
|
class Private;
|
||||||
|
|||||||
@@ -1802,6 +1802,11 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor)
|
|||||||
connect(ICore::instance(), &ICore::saveSettingsRequested,
|
connect(ICore::instance(), &ICore::saveSettingsRequested,
|
||||||
this, &FakeVimPluginPrivate::writeSettings);
|
this, &FakeVimPluginPrivate::writeSettings);
|
||||||
|
|
||||||
|
connect(handler, &FakeVimHandler::tabNextRequested,
|
||||||
|
this, [this] { triggerAction(Core::Constants::GOTONEXTINHISTORY); });
|
||||||
|
connect(handler, &FakeVimHandler::tabPreviousRequested,
|
||||||
|
this, [this] { triggerAction(Core::Constants::GOTOPREVINHISTORY); });
|
||||||
|
|
||||||
handler->setCurrentFileName(editor->document()->filePath().toString());
|
handler->setCurrentFileName(editor->document()->filePath().toString());
|
||||||
handler->installEventFilter();
|
handler->installEventFilter();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user