diff --git a/main.ts b/main.ts index 1233456..024bcfb 100644 --- a/main.ts +++ b/main.ts @@ -197,6 +197,27 @@ export default class LoomPlugin extends Plugin { hotkeys: [{ modifiers: ["Alt"], key: "c" }], }); + this.addCommand({ + id: "loom-toggle-collapse-current-node", + name: "Toggle whether current node is collapsed", + icon: "folder", + callback: () => { + const file = this.app.workspace.getActiveFile(); + if (!file) return; + + const state = this.state[file.path]; + + this.app.workspace.trigger("loom:toggle-collapse", state.current); + }, + hotkeys: [{ modifiers: ["Alt"], key: "Enter" }], + }); + + this.addCommand({ + id: "loom-open-pane", + name: "Open Loom pane", + callback: () => this.app.workspace.getRightLeaf(false).setViewState({ type: "loom" }), + }); + this.addCommand({ id: "loom-debug-reset-state", name: "Debug: Reset state",