From b22cefb0d456af078356c7323fe80aec4c8aec92 Mon Sep 17 00:00:00 2001 From: Logan Yang Date: Sun, 16 Apr 2023 21:48:40 -0700 Subject: [PATCH] Add command for toggling chat view --- src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index d5da2aba..52937e2e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,8 +29,15 @@ export default class CopilotPlugin extends Plugin { (leaf: WorkspaceLeaf) => new CopilotView(leaf, this) ); + this.addCommand({ + id: 'copilot-chat-toggle-window', + name: 'Toggle Copilot Chat Window', + callback: () => { + this.toggleView(); + } + }); + this.addRibbonIcon('message-square', 'Copilot Chat', (evt: MouseEvent) => { - // open or close the chatgpt view this.toggleView(); }); }