瀏覽代碼

Fixes issue with copy to clipboard with no active editor

main
Eric Amodio 7 年之前
父節點
當前提交
f837de7430
共有 2 個檔案被更改,包括 2 行新增2 行删除
  1. +1
    -1
      src/commands/copyMessageToClipboard.ts
  2. +1
    -1
      src/commands/copyShaToClipboard.ts

+ 1
- 1
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;

+ 1
- 1
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;

Loading…
取消
儲存