A3: name the adoption wait adopted(), not a second settled()
The editor store already has settled(id) for buffer sync; a second declaration shadowed it (caught by vue-tsc). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c80ab87c9
commit
6fbfb08a50
3 changed files with 4 additions and 4 deletions
|
|
@ -252,7 +252,7 @@ onMounted(() => {
|
||||||
run: async (params) => {
|
run: async (params) => {
|
||||||
const given = (params as { path?: unknown } | null)?.path;
|
const given = (params as { path?: unknown } | null)?.path;
|
||||||
if (typeof given !== "string" || given === "") {
|
if (typeof given !== "string" || given === "") {
|
||||||
await editor.settled();
|
await editor.adopted();
|
||||||
}
|
}
|
||||||
const path = typeof given === "string" && given !== "" ? given : editor.activeTab?.path;
|
const path = typeof given === "string" && given !== "" ? given : editor.activeTab?.path;
|
||||||
if (path !== undefined) {
|
if (path !== undefined) {
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@ export const useEditorStore = defineStore("editor", () => {
|
||||||
* command right after `file.open` (over the control channel) sees the
|
* command right after `file.open` (over the control channel) sees the
|
||||||
* new tab as the active one.
|
* new tab as the active one.
|
||||||
*/
|
*/
|
||||||
async function settled(): Promise<void> {
|
async function adopted(): Promise<void> {
|
||||||
await Promise.all([...adopting]);
|
await Promise.all([...adopting]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -538,7 +538,7 @@ export const useEditorStore = defineStore("editor", () => {
|
||||||
tabs,
|
tabs,
|
||||||
activeId,
|
activeId,
|
||||||
activeTab,
|
activeTab,
|
||||||
settled,
|
adopted,
|
||||||
closePrompt,
|
closePrompt,
|
||||||
lastError,
|
lastError,
|
||||||
lastOpen,
|
lastOpen,
|
||||||
|
|
|
||||||
|
|
@ -515,7 +515,7 @@ describe("blame commands in the main layout (M4.7)", () => {
|
||||||
await commands.execute(TOGGLE_BLAME_COMMAND, { path: "src/a.php" });
|
await commands.execute(TOGGLE_BLAME_COMMAND, { path: "src/a.php" });
|
||||||
expect(isBlameShown("src/a.php")).toBe(false);
|
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, {});
|
await commands.execute(TOGGLE_BLAME_COMMAND, {});
|
||||||
expect(isBlameShown("src/opened.php")).toBe(true);
|
expect(isBlameShown("src/opened.php")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue