From f8f681b523a6ccddd6658b76b78c65100e1d99ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=96=87=E6=B6=9B?= Date: Fri, 18 Oct 2024 15:56:39 +0800 Subject: [PATCH] fix edit command prefix and suffix range bug maxStartLine should minus 1 curEndLine should plus 1 --- core/commands/slash/edit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/commands/slash/edit.ts b/core/commands/slash/edit.ts index c39fb2dc0..aafafa67e 100644 --- a/core/commands/slash/edit.ts +++ b/core/commands/slash/edit.ts @@ -95,10 +95,10 @@ export async function getPromptParts( } let filePrefix = fullFileContentsList - .slice(curStartLine, maxStartLine) + .slice(curStartLine, maxStartLine - 1) .join("\n"); let fileSuffix = fullFileContentsList - .slice(minEndLine, curEndLine - 1) + .slice(minEndLine, curEndLine + 1) .join("\n"); if (rif.contents.length > 0) {