Skip to content

Commit

Permalink
"fixed" issue #13
Browse files Browse the repository at this point in the history
Hotkeys will no longer show up on the explorer
context menu (except for the "open BC" hotkey
combination since that one works)
  • Loading branch information
CalShucha-ScooterSoftware committed Feb 21, 2024
1 parent c587840 commit c0f20aa
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 10 deletions.
29 changes: 25 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@
"title": "Compare Text to Clipboard Contents",
"category": "Beyond Compare",
"enablement": "editorHasSelection"
},
{
"command": "bcompare-vscode.selectLeftExplorer",
"title": "Select Left File",
"category": "Beyond Compare"
},
{
"command": "bcompare-vscode.compareWithLeftExplorer",
"title": "Compare to Left File",
"category": "Beyond Compare",
"enablement": "bcompare-vscode.leftSelected"
},
{
"command": "bcompare-vscode.compareWithFileExplorer",
"title": "Compare to File...",
"category": "Beyond Compare"
},
{
"command": "bcompare-vscode.compareParentExplorer",
"title": "Compare Parent to Folder...",
"category": "Beyond Compare"
}
],
"submenus": [
Expand Down Expand Up @@ -242,22 +263,22 @@
"group": "2general@4"
},
{
"command": "bcompare-vscode.compareParent",
"command": "bcompare-vscode.compareParentExplorer",
"when": "explorerResourceIsFolder === false && resourceScheme === file",
"group": "2general@3"
},
{
"command": "bcompare-vscode.selectLeft",
"command": "bcompare-vscode.selectLeftExplorer",
"when": "explorerResourceIsFolder === false",
"group": "1LeftRight"
},
{
"command": "bcompare-vscode.compareWithLeft",
"command": "bcompare-vscode.compareWithLeftExplorer",
"when": "explorerResourceIsFolder === false && bcompare-vscode.leftSelected",
"group": "1LeftRight"
},
{
"command": "bcompare-vscode.compareWithFile",
"command": "bcompare-vscode.compareWithFileExplorer",
"when": "explorerResourceIsFolder === false",
"group": "2general@1"
},
Expand Down
51 changes: 45 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,17 @@ export function activate(context: vscode.ExtensionContext) {
// });


registerCommand('.selectLeft', async (a) =>
registerCommand('.selectLeft', (a) =>
{
selectLeft(a);
});

registerCommand('.selectLeftExplorer', (a) =>
{
selectLeft(a);
});

async function selectLeft(a: any)
{
let success = false;
let leftFileName : string = "";
Expand Down Expand Up @@ -140,9 +150,19 @@ export function activate(context: vscode.ExtensionContext) {

vscode.window.showInformationMessage("Marked \"" + leftFileName + "\" as left file");
}
}

registerCommand('.compareWithLeft', (a) =>
{
compareWithLeft(a);
});

registerCommand('.compareWithLeftExplorer', (a) =>
{
compareWithLeft(a);
});

registerCommand('.compareWithLeft', async (a) =>
async function compareWithLeft(a: any)
{
let rightPath : string | false = "";
let blnRRO : boolean = false;
Expand Down Expand Up @@ -204,7 +224,7 @@ export function activate(context: vscode.ExtensionContext) {
openBC(option, [strLeftLabel, rightLabel], leftPath, rightPath);
clearLeftPath();
}
});
}

registerCommand('.selectLeftFolder', (a) =>
{
Expand Down Expand Up @@ -245,6 +265,16 @@ export function activate(context: vscode.ExtensionContext) {
});

registerCommand('.compareWithFile', (a) =>
{
compareWithFile(a);
});

registerCommand('.compareWithFileExplorer', (a) =>
{
compareWithFile(a);
});

function compareWithFile(a : any)
{
let options =
{
Expand Down Expand Up @@ -289,7 +319,7 @@ export function activate(context: vscode.ExtensionContext) {
openBC(options, [a.fsPath, file[0].fsPath], aFile, compFile);
}
});
});
}

registerCommand('.compareWithFolder', (a) =>
{
Expand All @@ -314,7 +344,16 @@ export function activate(context: vscode.ExtensionContext) {

registerCommand('.compareParent', (a) =>
{

compareParent(a);
});

registerCommand('.compareParentExplorer', (a) =>
{
compareParent(a);
});

function compareParent(a : any)
{
let success = false;
var fullPath: String;
if(a)
Expand Down Expand Up @@ -381,7 +420,7 @@ export function activate(context: vscode.ExtensionContext) {

openBC("", ["",""], folderPath ,folder[0].fsPath);
});
});
}

registerCommand('.compareWithSave', async (a) =>
{
Expand Down

0 comments on commit c0f20aa

Please sign in to comment.