mirror of
https://github.com/adiguno/hello-nemesis.git
synced 2026-07-22 05:37:31 +00:00
when clicking ribbon open the new leaf/view
This commit is contained in:
parent
d2ff2fa9fd
commit
2b4d11068d
1 changed files with 11 additions and 0 deletions
11
main.ts
11
main.ts
|
|
@ -30,6 +30,12 @@ const DEFAULT_SETTINGS: MyPluginSettings = {
|
|||
export default class NemesisPlugin extends Plugin {
|
||||
settings: MyPluginSettings;
|
||||
|
||||
async testFunction() {
|
||||
const { workspace } = this.app;
|
||||
|
||||
// let a = await workspace.ensureSideLeaf(VIEW_TYPE_EXAMPLE, "right");
|
||||
// console.log(a);
|
||||
}
|
||||
async activateView() {
|
||||
const { workspace } = this.app;
|
||||
let leaf: WorkspaceLeaf | null = null;
|
||||
|
|
@ -47,6 +53,10 @@ export default class NemesisPlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
}
|
||||
if (leaf) {
|
||||
workspace.revealLeaf(leaf);
|
||||
workspace.setActiveLeaf(leaf);
|
||||
}
|
||||
}
|
||||
|
||||
async onload() {
|
||||
|
|
@ -67,6 +77,7 @@ export default class NemesisPlugin extends Plugin {
|
|||
new Notice("This is a notice!");
|
||||
console.log("click");
|
||||
this.activateView();
|
||||
this.testFunction();
|
||||
// console.log(`My openai key: ${this.settings.openAiKey}`);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue