Bläddra i källkod

Fixes more context menu commands (for real)

Caused by c75d5fed27
main
Eric Amodio 4 år sedan
förälder
incheckning
56e2ea2b0e
3 ändrade filer med 3 tillägg och 6 borttagningar
  1. +1
    -4
      src/commands/common.ts
  2. +1
    -1
      src/commands/diffWithPrevious.ts
  3. +1
    -1
      src/commands/diffWithWorking.ts

+ 1
- 4
src/commands/common.ts Visa fil

@ -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];
}
}

+ 1
- 1
src/commands/diffWithPrevious.ts Visa fil

@ -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;
}
}

+ 1
- 1
src/commands/diffWithWorking.ts Visa fil

@ -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;
}
}

Laddar…
Avbryt
Spara