Kaynağa Gözat

Fixes more context menu commands (for real)

Caused by c75d5fed27
main
Eric Amodio 4 yıl önce
ebeveyn
işleme
56e2ea2b0e
3 değiştirilmiş dosya ile 3 ekleme ve 6 silme
  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 Dosyayı Görüntüle

@ -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 Dosyayı Görüntüle

@ -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 Dosyayı Görüntüle

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

Yükleniyor…
İptal
Kaydet