diff --git a/.changeset/slimy-paths-design.md b/.changeset/slimy-paths-design.md new file mode 100644 index 00000000000..7a46f4b7d04 --- /dev/null +++ b/.changeset/slimy-paths-design.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Fixed bug that prevented some file links from working in the Agent output diff --git a/src/integrations/misc/open-file.ts b/src/integrations/misc/open-file.ts index 52352314b3e..d48bda6401a 100644 --- a/src/integrations/misc/open-file.ts +++ b/src/integrations/misc/open-file.ts @@ -77,7 +77,9 @@ export async function openFile(filePath: string, options: OpenFileOptions = {}) const document = await vscode.workspace.openTextDocument(uri) const selection = - options.line !== undefined ? new vscode.Selection(options.line - 1, 0, options.line - 1, 0) : undefined + options.line !== undefined + ? new vscode.Selection(Math.max(options.line - 1, 0), 0, Math.max(options.line - 1, 0), 0) + : undefined await vscode.window.showTextDocument(document, { preview: false, selection,