mirror of
https://github.com/cosmicoptima/loom.git
synced 2026-07-22 07:40:25 +00:00
Add toggle collapse and open pane commands
This commit is contained in:
parent
99c7835da1
commit
55a2ff456f
1 changed files with 21 additions and 0 deletions
21
main.ts
21
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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue