From a187ff7dfe8cbd45cd46cbca333747eda7dad344 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 24 Feb 2025 00:10:15 -0800 Subject: [PATCH] if input not templated, render it at the end of slash command --- core/commands/index.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/commands/index.ts b/core/commands/index.ts index f4a0084da..2b44a4d66 100644 --- a/core/commands/index.ts +++ b/core/commands/index.ts @@ -20,11 +20,16 @@ export function slashFromCustomCommand( } // Render prompt template - const promptUserInput = await renderTemplatedString( - customCommand.prompt, - ide.readFile.bind(ide), - { input: userInput }, - ); + let promptUserInput: string; + if (customCommand.prompt.includes("{{{ input }}}")) { + promptUserInput = await renderTemplatedString( + customCommand.prompt, + ide.readFile.bind(ide), + { input: userInput }, + ); + } else { + promptUserInput = customCommand.prompt + "\n\n" + userInput; + } const messages = [...history]; // Find the last chat message with this slash command and replace it with the user input