Skip to content

Commit

Permalink
Merge pull request #2480 from codefori/fix/compare_files
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam authored Jan 26, 2025
2 parents 2848a5f + 2816cb6 commit 79f5720
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Instance from "../Instance";

let selectedForCompare: Uri;

const VSCODE_DIFF_COMMAND = `vscode.diff`;

export function registerCompareCommands(instance: Instance): Disposable[] {
return [
commands.registerCommand(`code-for-ibmi.selectForCompare`, async (node) => {
Expand Down Expand Up @@ -32,7 +34,7 @@ export function registerCompareCommands(instance: Instance): Disposable[] {
}

if (uri) {
commands.executeCommand(`diff`, selectedForCompare, uri);
commands.executeCommand(VSCODE_DIFF_COMMAND, selectedForCompare, uri);
} else {
window.showErrorMessage(`No compare to path provided.`);
}
Expand Down Expand Up @@ -66,7 +68,7 @@ export function registerCompareCommands(instance: Instance): Disposable[] {
if (editor) {
activeFile = editor.document.uri;
if (activeFile) {
commands.executeCommand(`diff`, activeFile, selectedFile);
commands.executeCommand(VSCODE_DIFF_COMMAND, activeFile, selectedFile);
} else {
window.showInformationMessage(l10n.t(`No file is open or selected`));
}
Expand Down Expand Up @@ -109,7 +111,7 @@ async function compareCurrentFile(node: any, scheme: `streamfile` | `file` | `me
compareWith = `/${compareWith}`;
}
let uri = Uri.parse(`${scheme}:${compareWith}`);
commands.executeCommand(`vscode.diff`, currentFile, uri);
commands.executeCommand(VSCODE_DIFF_COMMAND, currentFile, uri);
}
} else {
window.showInformationMessage(l10n.t(`No file is open or selected`));
Expand Down

0 comments on commit 79f5720

Please sign in to comment.