From 84dbd5628ae46d59608ccfdebb3853c9e4f8b9d8 Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:00:55 +0900 Subject: [PATCH 1/7] lineWidth 120 --- biome.jsonc | 3 ++- denops/aider/main.ts | 44 ++++++++++++-------------------------------- 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index f2d02bf..94854ab 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -11,7 +11,8 @@ }, "formatter": { "enabled": true, - "indentStyle": "space" + "indentStyle": "space", + "lineWidth": 120 }, "organizeImports": { "enabled": true diff --git a/denops/aider/main.ts b/denops/aider/main.ts index ddf1622..9f2952f 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -22,9 +22,11 @@ export async function main(denops: Denops): Promise { * "0"の場合は引数なしの関数、"1"の場合は1つの引数を取る関数、 * "*"の場合は2つの引数を取る関数を意味します。 */ - type ImplType = T extends "0" ? () => Promise - : T extends "1" ? (arg: string) => Promise - : (arg: string, arg2: string) => Promise; // MEMO: ArgCountは*だが現状2つのみ対応している + type ImplType = T extends "0" + ? () => Promise + : T extends "1" + ? (arg: string) => Promise + : (arg: string, arg2: string) => Promise; // MEMO: ArgCountは*だが現状2つのみ対応している /** * コマンドのオプションを定義 @@ -36,9 +38,7 @@ export async function main(denops: Denops): Promise { * @property {boolean} [range] - 範囲指定が可能かどうかを示します。 */ type Opts = { - pattern?: T extends "0" ? undefined - : T extends "1" ? "[]" - : "[, ]"; + pattern?: T extends "0" ? undefined : T extends "1" ? "[]" : "[, ]"; complete?: T extends "1" ? "file" | "shellcmd" : undefined; range?: T extends "*" ? boolean : undefined; }; @@ -67,11 +67,7 @@ export async function main(denops: Denops): Promise { ): Promise { const rangePart = opts.range ? "-range" : ""; - const commandName = `Aider${dispatcherMethod.charAt(0).toUpperCase()}${ - dispatcherMethod.slice( - 1, - ) - }`; + const commandName = `Aider${dispatcherMethod.charAt(0).toUpperCase()}${dispatcherMethod.slice(1)}`; const completePart = opts.complete ? `-complete=${opts.complete}` : ""; const patternPart = opts.pattern ?? "[]"; @@ -86,11 +82,7 @@ export async function main(denops: Denops): Promise { const openBufferType: BufferLayout = await buffer.getOpenBufferType(denops); - async function addFileToAider( - denops: Denops, - openBufferType: BufferLayout, - prefix: string, - ): Promise { + async function addFileToAider(denops: Denops, openBufferType: BufferLayout, prefix: string): Promise { const currentBufnr = await fn.bufnr(denops, "%"); const aiderBuffer = await buffer.getAiderBuffer(denops); @@ -195,20 +187,13 @@ export async function main(denops: Denops): Promise { "visualTextWithPrompt", "*", async (start: string, end: string) => { - await buffer.openFloatingWindowWithSelectedCode( - denops, - start, - end, - openBufferType, - ); + await buffer.openFloatingWindowWithSelectedCode(denops, start, end, openBufferType); }, { pattern: "[, ]", range: true }, ), await command("openIgnore", "0", async () => { - const gitRoot = ( - await fn.system(denops, "git rev-parse --show-toplevel") - ).trim(); + const gitRoot = (await fn.system(denops, "git rev-parse --show-toplevel")).trim(); const filePathToOpen = `${gitRoot}/.aiderignore`; if (await fn.filereadable(denops, filePathToOpen)) { await denops.cmd(`edit ${filePathToOpen}`); @@ -219,9 +204,7 @@ export async function main(denops: Denops): Promise { await command("addIgnoreCurrentFile", "0", async () => { const currentFile = await getCurrentFilePath(denops); - const gitRoot = ( - await fn.system(denops, "git rev-parse --show-toplevel") - ).trim(); + const gitRoot = (await fn.system(denops, "git rev-parse --show-toplevel")).trim(); const filePathToOpen = `${gitRoot}/.aiderignore`; const relativePath = currentFile.replace(gitRoot, ""); @@ -247,9 +230,6 @@ export async function main(denops: Denops): Promise { ]; denops.dispatcher = Object.fromEntries( - commands.map((command) => [ - command.methodName, - command.impl as (args: unknown) => Promise, - ]), + commands.map((command) => [command.methodName, command.impl as (args: unknown) => Promise]), ); } From b71d18fb01c065b9345e8b2a42bc59227dc60abf Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:01:09 +0900 Subject: [PATCH 2/7] voice command --- denops/aider/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 9f2952f..b2d98f9 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -218,6 +218,11 @@ export async function main(denops: Denops): Promise { } }), + await command("voice", "0", async () => { + const prompt = "/voice"; + await buffer.sendPromptWithInput(denops, prompt); + }), + await command( "test", "1", From b5f0675a0790a9d989b07f2210d886d9487aad3f Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:05:37 +0900 Subject: [PATCH 3/7] feedkeys("a"); // Start insert mode --- denops/aider/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/denops/aider/main.ts b/denops/aider/main.ts index b2d98f9..177593f 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -221,6 +221,7 @@ export async function main(denops: Denops): Promise { await command("voice", "0", async () => { const prompt = "/voice"; await buffer.sendPromptWithInput(denops, prompt); + await fn.feedkeys(denops, "a"); // Start insert mode to accepet Enter key }), await command( From 5b8b3079ef64d70919e669d03aeb5d86cdd3ee91 Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:07:37 +0900 Subject: [PATCH 4/7] rename: sendPromptWithInput -> sendPrompt --- denops/aider/bufferOperation.ts | 162 +++++++------------------------- denops/aider/main.ts | 16 ++-- 2 files changed, 41 insertions(+), 137 deletions(-) diff --git a/denops/aider/bufferOperation.ts b/denops/aider/bufferOperation.ts index 54a8012..f98d4b9 100644 --- a/denops/aider/bufferOperation.ts +++ b/denops/aider/bufferOperation.ts @@ -3,11 +3,7 @@ import { feedkeys } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts" import * as n from "https://deno.land/x/denops_std@v6.4.0/function/nvim/mod.ts"; import type { Denops } from "https://deno.land/x/denops_std@v6.4.0/mod.ts"; import * as v from "https://deno.land/x/denops_std@v6.4.0/variable/mod.ts"; -import { - ensure, - is, - maybe, -} from "https://deno.land/x/unknownutil@v3.17.0/mod.ts"; +import { ensure, is, maybe } from "https://deno.land/x/unknownutil@v3.17.0/mod.ts"; import { aider } from "./aiderCommand.ts"; import { getPromptFromVimVariable } from "./utils.ts"; @@ -24,12 +20,7 @@ export type BufferLayout = (typeof bufferLayouts)[number]; * floating: floating window */ export async function getOpenBufferType(denops: Denops): Promise { - return ( - maybe( - await v.g.get(denops, "aider_buffer_open_type"), - is.LiteralOneOf(bufferLayouts), - ) ?? "floating" - ); + return maybe(await v.g.get(denops, "aider_buffer_open_type"), is.LiteralOneOf(bufferLayouts)) ?? "floating"; } export async function exitAiderBuffer(denops: Denops): Promise { @@ -52,17 +43,11 @@ export async function exitAiderBuffer(denops: Denops): Promise { * @param {BufferLayout} openBufferType - The type of buffer to open. * @returns {Promise} */ -export async function openAiderBuffer( - denops: Denops, - openBufferType: BufferLayout, -): Promise { +export async function openAiderBuffer(denops: Denops, openBufferType: BufferLayout): Promise { const aiderBuf = await getAiderBuffer(denops); if (openBufferType === "floating") { if (aiderBuf === undefined) { - const bufnr = ensure( - await n.nvim_create_buf(denops, false, true), - is.Number, - ); + const bufnr = ensure(await n.nvim_create_buf(denops, false, true), is.Number); await openFloatingWindow(denops, bufnr); await aider().run(denops); return; @@ -84,10 +69,7 @@ export async function openAiderBuffer( } } -export async function sendPromptWithInput( - denops: Denops, - input: string, -): Promise { +export async function sendPrompt(denops: Denops, input: string): Promise { const aiderBuf = await getAiderBuffer(denops); if (aiderBuf === undefined) { await denops.cmd("echo 'Aider is not running'"); @@ -108,14 +90,8 @@ export async function sendPromptWithInput( /** バッファ内の内容をプロンプトとして送信する */ -export async function sendPromptByBuffer( - denops: Denops, - openBufferType: BufferLayout, -): Promise { - const bufferContent = ensure( - await denops.call("getbufline", "%", 1, "$"), - is.ArrayOf(is.String), - ).join("\n"); +export async function sendPromptByBuffer(denops: Denops, openBufferType: BufferLayout): Promise { + const bufferContent = ensure(await denops.call("getbufline", "%", 1, "$"), is.ArrayOf(is.String)).join("\n"); await denops.cmd("bdelete!"); @@ -134,10 +110,7 @@ export async function openFloatingWindowWithSelectedCode( end: unknown, openBufferType: BufferLayout, ): Promise { - const words = ensure( - await denops.call("getline", start, end), - is.ArrayOf(is.String), - ); + const words = ensure(await denops.call("getline", start, end), is.ArrayOf(is.String)); const aiderBuf = await getAiderBuffer(denops); if (openBufferType !== "floating") { if (aiderBuf === undefined) { @@ -146,10 +119,7 @@ export async function openFloatingWindowWithSelectedCode( return; } } - const backupPrompt = await getPromptFromVimVariable( - denops, - "aider_visual_select_buffer_prompt", - ); + const backupPrompt = await getPromptFromVimVariable(denops, "aider_visual_select_buffer_prompt"); const bufnr = ensure(await n.nvim_create_buf(denops, false, true), is.Number); await openFloatingWindow(denops, bufnr); @@ -164,26 +134,12 @@ export async function openFloatingWindowWithSelectedCode( await n.nvim_buf_set_keymap(denops, bufnr, "n", "q", "close!", { silent: true, }); - await n.nvim_buf_set_keymap( - denops, - bufnr, - "n", - "Q", - "AiderHideVisualSelectFloatingWindow", - { - silent: true, - }, - ); - await n.nvim_buf_set_keymap( - denops, - bufnr, - "n", - "", - "AiderSendPrompt", - { - silent: true, - }, - ); + await n.nvim_buf_set_keymap(denops, bufnr, "n", "Q", "AiderHideVisualSelectFloatingWindow", { + silent: true, + }); + await n.nvim_buf_set_keymap(denops, bufnr, "n", "", "AiderSendPrompt", { + silent: true, + }); } /** @@ -196,11 +152,7 @@ export async function openFloatingWindowWithSelectedCode( * @param {number} bufnr - バッファ番号。 * @param {string[]} backupPrompt - バックアッププロンプトの内容。 */ -async function handleBackupPrompt( - denops: Denops, - bufnr: number, - backupPrompt: string[], -) { +async function handleBackupPrompt(denops: Denops, bufnr: number, backupPrompt: string[]) { await v.g.set(denops, "aider_visual_select_buffer_prompt", undefined); await n.nvim_buf_set_lines(denops, bufnr, 0, -1, true, backupPrompt); await feedkeys(denops, "Gi"); @@ -216,15 +168,8 @@ async function handleBackupPrompt( * @param {number} bufnr - バッファ番号。 * @param {string[]} words - バッファに設定するコード行。 */ -async function handleNoBackupPrompt( - denops: Denops, - bufnr: number, - words: string[], -) { - const filetype = ensure( - await fn.getbufvar(denops, "%", "&filetype"), - is.String, - ); +async function handleNoBackupPrompt(denops: Denops, bufnr: number, words: string[]) { + const filetype = ensure(await fn.getbufvar(denops, "%", "&filetype"), is.String); // biome-ignore lint: ignore useTemplate to avoid \`\`\` words.unshift("```" + filetype); words.push("```"); @@ -233,10 +178,7 @@ async function handleNoBackupPrompt( await n.nvim_buf_set_lines(denops, bufnr, 0, 1, true, []); await n.nvim_buf_set_lines(denops, bufnr, -1, -1, true, [""]); - const additionalPrompt = await getPromptFromVimVariable( - denops, - "aider_additional_prompt", - ); + const additionalPrompt = await getPromptFromVimVariable(denops, "aider_additional_prompt"); if (additionalPrompt) { await n.nvim_buf_set_lines(denops, bufnr, -1, -1, true, ["# rule"]); await n.nvim_buf_set_lines(denops, bufnr, -1, -1, true, additionalPrompt); @@ -247,13 +189,8 @@ async function handleNoBackupPrompt( await feedkeys(denops, "Gi"); } -export async function hideVisualSelectFloatingWindow( - denops: Denops, -): Promise { - const bufferContent = ensure( - await denops.call("getbufline", "%", 1, "$"), - is.ArrayOf(is.String), - ); +export async function hideVisualSelectFloatingWindow(denops: Denops): Promise { + const bufferContent = ensure(await denops.call("getbufline", "%", 1, "$"), is.ArrayOf(is.String)); await v.g.set(denops, "aider_visual_select_buffer_prompt", bufferContent); await denops.cmd("close!"); @@ -265,10 +202,7 @@ export async function hideVisualSelectFloatingWindow( * @param {number} bufnr - バッファ番号 * @returns {Promise} */ -export async function checkIfTerminalBuffer( - denops: Denops, - bufnr: number, -): Promise { +export async function checkIfTerminalBuffer(denops: Denops, bufnr: number): Promise { const buftype = await fn.getbufvar(denops, bufnr, "&buftype"); return buftype === "terminal"; } @@ -290,24 +224,11 @@ export async function openSplitWindow(denops: Denops): Promise { * @param {number} bufnr - The buffer number. * @returns {Promise} */ -async function openFloatingWindow( - denops: Denops, - bufnr: number, -): Promise { - const terminal_width = Math.floor( - ensure(await n.nvim_get_option(denops, "columns"), is.Number), - ); - const terminal_height = Math.floor( - ensure(await n.nvim_get_option(denops, "lines"), is.Number), - ); - const floatWinHeight = ensure( - await v.g.get(denops, "aider_floatwin_height"), - is.Number, - ); - const floatWinWidth = ensure( - await v.g.get(denops, "aider_floatwin_width"), - is.Number, - ); +async function openFloatingWindow(denops: Denops, bufnr: number): Promise { + const terminal_width = Math.floor(ensure(await n.nvim_get_option(denops, "columns"), is.Number)); + const terminal_height = Math.floor(ensure(await n.nvim_get_option(denops, "lines"), is.Number)); + const floatWinHeight = ensure(await v.g.get(denops, "aider_floatwin_height"), is.Number); + const floatWinWidth = ensure(await v.g.get(denops, "aider_floatwin_width"), is.Number); const row = Math.floor((terminal_height - floatWinHeight) / 2); const col = Math.floor((terminal_width - floatWinWidth) / 2); @@ -323,10 +244,7 @@ async function openFloatingWindow( await denops.cmd("set nonumber"); } -async function sendPromptFromFloatingWindow( - denops: Denops, - prompt: string, -): Promise { +async function sendPromptFromFloatingWindow(denops: Denops, prompt: string): Promise { const aiderBuf = await getAiderBuffer(denops); if (aiderBuf === undefined) { return; @@ -350,10 +268,7 @@ async function sendPromptFromFloatingWindow( * @param {Denops} denops - Denopsインスタンス * @param {string} prompt - 送信するプロンプト */ -async function sendPromptFromSplitWindow( - denops: Denops, - prompt: string, -): Promise { +async function sendPromptFromSplitWindow(denops: Denops, prompt: string): Promise { const aiderBuf = await getAiderBuffer(denops); if (aiderBuf === undefined) { return; @@ -362,10 +277,7 @@ async function sendPromptFromSplitWindow( if ((await v.g.get(denops, "aider_buffer_open_type")) !== "floating") { await denops.cmd(`${aiderBuf.winnr}wincmd w`); } else { - const totalWindows = ensure( - await denops.call("winnr", "$"), - is.Number, - ); + const totalWindows = ensure(await denops.call("winnr", "$"), is.Number); for (let winnr = 1; winnr <= totalWindows; winnr++) { const bufnr = await denops.call("winbufnr", winnr); @@ -394,9 +306,7 @@ type AiderBuffer = { * @param {Denops} denops - The Denops instance. * @returns {Promise} The buffer number or undefined. */ -export async function getAiderBuffer( - denops: Denops, -): Promise { +export async function getAiderBuffer(denops: Denops): Promise { // Get all open buffer numbers const buf_count = ensure(await fn.bufnr(denops, "$"), is.Number); @@ -404,10 +314,7 @@ export async function getAiderBuffer( const bufnr = ensure(await fn.bufnr(denops, i), is.Number); if (await aider().checkIfAiderBuffer(denops, bufnr)) { - const jobId = ensure( - await fn.getbufvar(denops, bufnr, "&channel"), - is.Number, - ); + const jobId = ensure(await fn.getbufvar(denops, bufnr, "&channel"), is.Number); // testMode時はjobを走らせていないのでその場合は0でも許容 // プロセスが動いていない場合(session復元時など)はバッファを削除 @@ -435,10 +342,7 @@ export async function getAiderBuffer( * @param {number} bufnrToCheck - 確認したいバッファ番号 * @returns {Promise} バッファが開かれている場合はtrue、そうでない場合はfalse */ -async function checkBufferOpen( - denops: Denops, - bufnrToCheck: number, -): Promise { +async function checkBufferOpen(denops: Denops, bufnrToCheck: number): Promise { const win_count = ensure(await fn.winnr(denops, "$"), is.Number); for (let i = 1; i <= win_count; i++) { const bufnr = ensure(await fn.winbufnr(denops, i), is.Number); diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 177593f..9431115 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -103,7 +103,7 @@ export async function main(denops: Denops): Promise { const currentFile = await getCurrentFilePath(denops); const prompt = `/${prefix} ${currentFile}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); } const commands: Command[] = [ @@ -132,7 +132,7 @@ export async function main(denops: Denops): Promise { async (path: string) => { const prompt = `/add ${path}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }, { pattern: "[]", complete: "file" }, ), @@ -147,7 +147,7 @@ export async function main(denops: Denops): Promise { async (path: string) => { const prompt = `/read-only ${path}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }, { pattern: "[]", complete: "file" }, ), @@ -161,14 +161,14 @@ export async function main(denops: Denops): Promise { "1", async (url: string) => { const prompt = `/web ${url}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }, { pattern: "[]" }, ), await command("paste", "0", async () => { const prompt = "/paste"; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }), await command( @@ -176,7 +176,7 @@ export async function main(denops: Denops): Promise { "1", async (question: string) => { const prompt = `/ask ${question}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }, { pattern: "[]" }, ), @@ -220,7 +220,7 @@ export async function main(denops: Denops): Promise { await command("voice", "0", async () => { const prompt = "/voice"; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); await fn.feedkeys(denops, "a"); // Start insert mode to accepet Enter key }), @@ -229,7 +229,7 @@ export async function main(denops: Denops): Promise { "1", async (cmd: string) => { const prompt = `/test ${cmd}`; - await buffer.sendPromptWithInput(denops, prompt); + await buffer.sendPrompt(denops, prompt); }, { pattern: "[]", complete: "shellcmd" }, ), From 5e60e92edcd9e8ad6863edd85a7f703408667474 Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:17:21 +0900 Subject: [PATCH 5/7] buffer.prepareAiderBuffer --- denops/aider/bufferOperation.ts | 11 +++++++++++ denops/aider/main.ts | 10 ++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/denops/aider/bufferOperation.ts b/denops/aider/bufferOperation.ts index f98d4b9..906e5bd 100644 --- a/denops/aider/bufferOperation.ts +++ b/denops/aider/bufferOperation.ts @@ -69,6 +69,17 @@ export async function openAiderBuffer(denops: Denops, openBufferType: BufferLayo } } +export async function prepareAiderBuffer(denops: Denops, openBufferType: BufferLayout): Promise { + if (openBufferType === "floating") { + await aider().silentRun(denops); + } else { + await openAiderBuffer(denops, openBufferType); + await denops.cmd("wincmd p"); + console.log("Run Command again."); + return; + } +} + export async function sendPrompt(denops: Denops, input: string): Promise { const aiderBuf = await getAiderBuffer(denops); if (aiderBuf === undefined) { diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 9431115..1752b96 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -1,4 +1,5 @@ import * as fn from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts"; +import { prepareAiderBuffer } from "./bufferOperation.ts"; import type { Denops } from "https://deno.land/x/denops_std@v6.4.0/mod.ts"; import { aider } from "./aiderCommand.ts"; import * as buffer from "./bufferOperation.ts"; @@ -87,14 +88,7 @@ export async function main(denops: Denops): Promise { const aiderBuffer = await buffer.getAiderBuffer(denops); if (!aiderBuffer) { - if (openBufferType === "floating") { - await aider().silentRun(denops); - } else { - await buffer.openAiderBuffer(denops, openBufferType); - await denops.cmd("wincmd p"); - console.log(`Run AiderAdd${prefix}CurrentFile again.`); - return; - } + buffer.prepareAiderBuffer(denops, openBufferType); } if (await buffer.checkIfTerminalBuffer(denops, currentBufnr)) { From 7bb34e659f16881a66c50decf54f9215c374489d Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:17:54 +0900 Subject: [PATCH 6/7] prepareAiderBuffer on voice command --- denops/aider/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 1752b96..078d584 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -214,6 +214,7 @@ export async function main(denops: Denops): Promise { await command("voice", "0", async () => { const prompt = "/voice"; + await buffer.prepareAiderBuffer(denops, openBufferType); await buffer.sendPrompt(denops, prompt); await fn.feedkeys(denops, "a"); // Start insert mode to accepet Enter key }), From 506af5b387fcf33cf94528b3cf25a65ff6566bca Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Sat, 12 Oct 2024 12:21:16 +0900 Subject: [PATCH 7/7] await!!!! --- denops/aider/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/denops/aider/main.ts b/denops/aider/main.ts index 078d584..0a0a10b 100644 --- a/denops/aider/main.ts +++ b/denops/aider/main.ts @@ -88,7 +88,7 @@ export async function main(denops: Denops): Promise { const aiderBuffer = await buffer.getAiderBuffer(denops); if (!aiderBuffer) { - buffer.prepareAiderBuffer(denops, openBufferType); + await buffer.prepareAiderBuffer(denops, openBufferType); } if (await buffer.checkIfTerminalBuffer(denops, currentBufnr)) {