Przeglądaj źródła

Fixes more context menu commands (for real)

Caused by c75d5fed27
main
Eric Amodio 4 lat temu
rodzic
commit
56e2ea2b0e
3 zmienionych plików z 3 dodań i 6 usunięć
  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 Wyświetl plik

@ -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 Wyświetl plik

@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz