diff --git a/src/commands/copyMessageToClipboard.ts b/src/commands/copyMessageToClipboard.ts index 06a6efe..0c6b164 100644 --- a/src/commands/copyMessageToClipboard.ts +++ b/src/commands/copyMessageToClipboard.ts @@ -28,11 +28,11 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand { return undefined; } - const line = editor.selection.active.line; const gitUri = GitUri.fromUri(uri, this.git); if (!message) { if (!sha) { + const line = editor.selection.active.line; const blameline = line - gitUri.offset; if (blameline < 0) return undefined; diff --git a/src/commands/copyShaToClipboard.ts b/src/commands/copyShaToClipboard.ts index ef212cb..64978f1 100644 --- a/src/commands/copyShaToClipboard.ts +++ b/src/commands/copyShaToClipboard.ts @@ -28,10 +28,10 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand { return undefined; } - const line = editor.selection.active.line; const gitUri = GitUri.fromUri(uri, this.git); if (!sha) { + const line = editor.selection.active.line; const blameline = line - gitUri.offset; if (blameline < 0) return undefined;