diff --git a/src/commands/common.ts b/src/commands/common.ts index ebc4bc3..e6099e7 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -392,9 +392,6 @@ export abstract class Command implements Disposable { // If the uri matches the active editor, then pass the active editor if (editor == null && uri.toString() === window.activeTextEditor?.document.uri.toString()) { editor = window.activeTextEditor; - } else { - // eslint-disable-next-line no-debugger - debugger; } const uris = rest[0]; @@ -448,7 +445,7 @@ export abstract class Command implements Disposable { return [{ command: command, type: 'scm-groups', scmResourceGroups: groups }, args.slice(count)]; } - return [{ command: command, type: 'unknown', editor: editor }, args]; + return [{ command: command, type: 'unknown', editor: editor, uri: editor?.document.uri }, args]; } } diff --git a/src/commands/diffWithPrevious.ts b/src/commands/diffWithPrevious.ts index 9d8be62..43b36c8 100644 --- a/src/commands/diffWithPrevious.ts +++ b/src/commands/diffWithPrevious.ts @@ -36,7 +36,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand { args = { ...args }; // Ensure we are on the right side -- context.uri is always the right-side uri, so ensure the editor matches, otherwise we are on the left - if (context.editor?.document.uri.toString() === context.uri?.toString()) { + if (context.editor == null || context.editor?.document.uri.toString() === context.uri?.toString()) { args.inDiffRightEditor = true; } } diff --git a/src/commands/diffWithWorking.ts b/src/commands/diffWithWorking.ts index 3e0066e..02c6737 100644 --- a/src/commands/diffWithWorking.ts +++ b/src/commands/diffWithWorking.ts @@ -26,7 +26,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand { args = { ...args }; // Ensure we are on the right side -- context.uri is always the right-side uri, so ensure the editor matches, otherwise we are on the left - if (context.editor?.document.uri.toString() === context.uri?.toString()) { + if (context.editor == null || context.editor?.document.uri.toString() === context.uri?.toString()) { args.inDiffRightEditor = true; } }