Skip to content

Commit 6c20c5d

Browse files
committed
fix(webview): Fix links to filename:0
1 parent 6f90d4c commit 6c20c5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)