fix(webview): Fix links to filename:0 (#3727)

* fix(webview): Fix links to filename:0

* Add changeset
This commit is contained in:
Remon Oldenbeuving 2025-05-19 21:44:36 +02:00 committed by GitHub
parent d70d0c1627
commit 8721ab5dcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Fixed bug that prevented some file links from working in the Agent output

View file

@ -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,