From 82a87b30a950a205f7deb9c1bd1f42d990c6285a Mon Sep 17 00:00:00 2001 From: Remon Oldenbeuving Date: Mon, 19 May 2025 21:44:36 +0200 Subject: [PATCH] fix(webview): Fix links to filename:0 (#3727) * fix(webview): Fix links to filename:0 * Add changeset --- .changeset/slimy-paths-design.md | 5 +++++ src/integrations/misc/open-file.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/slimy-paths-design.md diff --git a/.changeset/slimy-paths-design.md b/.changeset/slimy-paths-design.md new file mode 100644 index 0000000000..7a46f4b7d0 --- /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 52352314b3..d48bda6401 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,