diff --git a/ui/src/components/layout/MainLayout.vue b/ui/src/components/layout/MainLayout.vue index 1e8f5ac..65d4218 100644 --- a/ui/src/components/layout/MainLayout.vue +++ b/ui/src/components/layout/MainLayout.vue @@ -252,7 +252,7 @@ onMounted(() => { run: async (params) => { const given = (params as { path?: unknown } | null)?.path; if (typeof given !== "string" || given === "") { - await editor.settled(); + await editor.adopted(); } const path = typeof given === "string" && given !== "" ? given : editor.activeTab?.path; if (path !== undefined) { diff --git a/ui/src/stores/editor.ts b/ui/src/stores/editor.ts index b246609..f578ddc 100644 --- a/ui/src/stores/editor.ts +++ b/ui/src/stores/editor.ts @@ -453,7 +453,7 @@ export const useEditorStore = defineStore("editor", () => { * command right after `file.open` (over the control channel) sees the * new tab as the active one. */ - async function settled(): Promise { + async function adopted(): Promise { await Promise.all([...adopting]); } @@ -538,7 +538,7 @@ export const useEditorStore = defineStore("editor", () => { tabs, activeId, activeTab, - settled, + adopted, closePrompt, lastError, lastOpen, diff --git a/ui/tests/vcs/Log.test.ts b/ui/tests/vcs/Log.test.ts index 5f63859..1d4d142 100644 --- a/ui/tests/vcs/Log.test.ts +++ b/ui/tests/vcs/Log.test.ts @@ -515,7 +515,7 @@ describe("blame commands in the main layout (M4.7)", () => { await commands.execute(TOGGLE_BLAME_COMMAND, { path: "src/a.php" }); expect(isBlameShown("src/a.php")).toBe(false); - useEditorStore(pinia).handleEvent({ kind: "bufferOpened", id: 5 }); + useEditorStore(pinia).handleEvent({ kind: "bufferOpened", id: 5, path: "src/opened.php" }); await commands.execute(TOGGLE_BLAME_COMMAND, {}); expect(isBlameShown("src/opened.php")).toBe(true); });