Skip to content

Commit 8721ab5

Browse files
authored
fix(webview): Fix links to filename:0 (#3727)
* fix(webview): Fix links to filename:0 * Add changeset
1 parent d70d0c1 commit 8721ab5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/slimy-paths-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Fixed bug that prevented some file links from working in the Agent output

src/integrations/misc/open-file.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export async function openFile(filePath: string, options: OpenFileOptions = {})
7777

7878
const document = await vscode.workspace.openTextDocument(uri)
7979
const selection =
80-
options.line !== undefined ? new vscode.Selection(options.line - 1, 0, options.line - 1, 0) : undefined
80+
options.line !== undefined
81+
? new vscode.Selection(Math.max(options.line - 1, 0), 0, Math.max(options.line - 1, 0), 0)
82+
: undefined
8183
await vscode.window.showTextDocument(document, {
8284
preview: false,
8385
selection,

0 commit comments

Comments
 (0)