From d685d33aee53b519076a2a65a5c9d33523bb93f4 Mon Sep 17 00:00:00 2001 From: Luis Fontes Date: Thu, 28 Apr 2022 09:56:00 +0200 Subject: [PATCH] Fix issue in "copy file path with line" as it uses 0 based line numbers --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 9078427..31157f5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -149,7 +149,7 @@ const copyPathWithLine = () => { const editor = vscode.window.activeTextEditor if (editor) { const filePath = relativePathForUri(editor.document.uri) - const pos = editor.document.lineAt(editor.selection.active).range.start.line + const pos = editor.document.lineAt(editor.selection.active).range.start.line + 1 //range.start.line is zero indexed vscode.env.clipboard.writeText(`${filePath}#${pos}`) } }