From 57a9fee5a216717b8db8f94b5b073a72225ebe0d Mon Sep 17 00:00:00 2001 From: Liu Zhangjian Date: Tue, 3 Sep 2024 17:28:06 +0800 Subject: [PATCH] fix: Fixed an issue where `Ctrl + Tab` could not be used to toggle open files as title Log: fix issue --- src/plugins/codeeditor/gui/workspacewidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/codeeditor/gui/workspacewidget.cpp b/src/plugins/codeeditor/gui/workspacewidget.cpp index 6e21bd60c..7c5278b35 100644 --- a/src/plugins/codeeditor/gui/workspacewidget.cpp +++ b/src/plugins/codeeditor/gui/workspacewidget.cpp @@ -68,13 +68,13 @@ void WorkspaceWidgetPrivate::initActions() // add/del comment QAction *commentAction = new QAction(tr("Add/Delete Comment"), q); - auto cmd = ActionManager::instance()->registerAction(commentAction, "TextEditor.AddAndRemoveComment"); + auto cmd = ActionManager::instance()->registerAction(commentAction, "TextEditor.AddAndRemoveComment", { TextEditorContext }); cmd->setDefaultKeySequence(Qt::CTRL | Qt::Key_Slash); connect(commentAction, &QAction::triggered, this, &WorkspaceWidgetPrivate::handleSetComment); // show opened files QAction *showOpenedAction = new QAction(tr("Show opened files"), q); - cmd = ActionManager::instance()->registerAction(showOpenedAction, "TextEditor.ShowOpenedFiles"); + cmd = ActionManager::instance()->registerAction(showOpenedAction, "TextEditor.ShowOpenedFiles", { TextEditorContext }); cmd->setDefaultKeySequence(Qt::CTRL | Qt::Key_Tab); connect(showOpenedAction, &QAction::triggered, this, &WorkspaceWidgetPrivate::handleShowOpenedFiles);