Commit e829ca8e authored by hjk's avatar hjk

FakeVim: Fix gt/gT/:tabnext/:tabprevious

The mapping was there, but not connected to the core actions.

Change-Id: I9faa1c47afe409caaa0462740a6865d99d959b44
Reviewed-by: default avatarLukas Holecek <hluk@email.cz>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent eb0aa0b7
...@@ -2141,6 +2141,8 @@ public: ...@@ -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) ...@@ -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) ...@@ -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: ...@@ -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) ...@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment