Add command for toggling chat view

This commit is contained in:
Logan Yang 2023-04-16 21:48:40 -07:00
parent dde86e2f62
commit b22cefb0d4

View file

@ -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();
});
}