diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 1026217..afd823e 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -229,7 +229,12 @@ export async function main(denops: Denops): Promise { { pattern: "[]" }, ), - await command("exit", "0", () => buffer.exitAiderBuffer(denops)), + await command("exit", "0", async () => { + const aiderBuffer = await buffer.getAiderBuffer(denops); + if (aiderBuffer) { + buffer.exitAiderBuffer(denops); + } + }), await command( "visualTextWithPrompt",