fix(command_palette): text editor-based issues not working

This commit is contained in:
Elian Doran
2025-07-30 22:39:37 +03:00
parent 0e6b10e400
commit 11d086ef12

View File

@@ -244,6 +244,8 @@ class CommandRegistry {
if (command.keyboardAction && command.commandName) {
if (command.keyboardAction.scope === "note-tree") {
this.executeWithNoteTreeFocus(command.commandName);
} else if (command.keyboardAction.scope === "text-detail") {
this.executeWithTextDetail(command.commandName);
} else {
appContext.triggerCommand(command.commandName);
}
@@ -272,6 +274,17 @@ class CommandRegistry {
node: activeNode
});
}
private async executeWithTextDetail(actionName: CommandNames) {
const typeWidget = await appContext.tabManager.getActiveContext()?.getTypeWidget();
if (!typeWidget) {
return;
}
typeWidget.triggerCommand(actionName, {
ntxId: appContext.tabManager.activeNtxId
});
}
}
const commandRegistry = new CommandRegistry();