diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index b56107d9dd402d15512194971d14b642ac5e466e..21f218e03f577558413cfc72ce277a7e1df51765 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -2141,6 +2141,8 @@ public: bool handleExShiftCommand(const ExCommand &cmd); bool handleExSourceCommand(const ExCommand &cmd); bool handleExSubstituteCommand(const ExCommand &cmd); + bool handleExTabNextCommand(const ExCommand &cmd); + bool handleExTabPreviousCommand(const ExCommand &cmd); bool handleExWriteCommand(const ExCommand &cmd); bool handleExEchoCommand(const ExCommand &cmd); @@ -5561,6 +5563,24 @@ bool FakeVimHandler::Private::handleExSubstituteCommand(const ExCommand &cmd) 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 { QByteArray modes; @@ -6212,6 +6232,8 @@ bool FakeVimHandler::Private::handleExCommandHelper(ExCommand &cmd) || handleExShiftCommand(cmd) || handleExSourceCommand(cmd) || handleExSubstituteCommand(cmd) + || handleExTabNextCommand(cmd) + || handleExTabPreviousCommand(cmd) || handleExWriteCommand(cmd) || handleExEchoCommand(cmd); } diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index 38597b33ae770474656a07101ddfb74e488623df..4cb22d9df1c0a5dd3f57ae35fe8a8f6a7b4423f6 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -157,6 +157,8 @@ signals: void fold(FakeVimHandler *self, int depth, bool fold); void foldGoTo(FakeVimHandler *self, int count, bool current); void jumpToGlobalMark(FakeVimHandler *handler, QChar mark, bool backTickMode, const QString &fileName); + void tabNextRequested(FakeVimHandler *self); + void tabPreviousRequested(FakeVimHandler *self); public: class Private; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index a7f87c7ee43ed8eea21d80c96a174f8abd332040..5a914075a6da1fbba573cecce01a735867ece732 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1802,6 +1802,11 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor) connect(ICore::instance(), &ICore::saveSettingsRequested, 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->installEventFilter();