mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
fix(command_palette): text editor-based issues not working
This commit is contained in:
@@ -244,6 +244,8 @@ class CommandRegistry {
|
|||||||
if (command.keyboardAction && command.commandName) {
|
if (command.keyboardAction && command.commandName) {
|
||||||
if (command.keyboardAction.scope === "note-tree") {
|
if (command.keyboardAction.scope === "note-tree") {
|
||||||
this.executeWithNoteTreeFocus(command.commandName);
|
this.executeWithNoteTreeFocus(command.commandName);
|
||||||
|
} else if (command.keyboardAction.scope === "text-detail") {
|
||||||
|
this.executeWithTextDetail(command.commandName);
|
||||||
} else {
|
} else {
|
||||||
appContext.triggerCommand(command.commandName);
|
appContext.triggerCommand(command.commandName);
|
||||||
}
|
}
|
||||||
@@ -272,6 +274,17 @@ class CommandRegistry {
|
|||||||
node: activeNode
|
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();
|
const commandRegistry = new CommandRegistry();
|
||||||
|
|||||||
Reference in New Issue
Block a user