Skip to content

Commit

Permalink
Fix issue in "copy file path with line" as it uses 0 based line numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfontes19 committed Apr 28, 2022
1 parent 815320d commit d685d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
}
Expand Down

0 comments on commit d685d33

Please sign in to comment.