add "open workspace in tab" command

This commit is contained in:
Nystik
2026-04-03 12:19:24 +02:00
parent 6865c049a3
commit bd6161bd31
3 changed files with 52 additions and 0 deletions

View File

@@ -178,6 +178,18 @@ export function initWorkspacePatch() {
return data;
});
// Relay watcher events for workspaces.json to the plugin's config change handler,
// so creating/deleting workspaces in one tab updates the menu in other tabs.
fsShim.watch(".obsidian", (eventType, filename) => {
if (filename === "workspaces.json") {
plugin.loadData().then((data) => {
if (data) {
instance.workspaces = data.workspaces || {};
}
});
}
});
console.log("[ignis] Workspaces plugin patched, workspace:", window.__workspaceName || "(none)");
});