mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
💄
This commit is contained in:
parent
2f54b0001b
commit
91a02c7a0a
|
@ -60,8 +60,8 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"command": "git.openOldFile",
|
||||
"title": "%command.openOldFile%",
|
||||
"command": "git.openHEADFile",
|
||||
"title": "%command.openHEADFile%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
|
@ -252,7 +252,7 @@
|
|||
"when": "config.git.enabled && scmProvider == git && gitState == idle"
|
||||
},
|
||||
{
|
||||
"command": "git.openOldFile",
|
||||
"command": "git.openHEADFile",
|
||||
"when": "config.git.enabled && scmProvider == git && gitState == idle"
|
||||
},
|
||||
{
|
||||
|
@ -523,7 +523,7 @@
|
|||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "git.openOldFile",
|
||||
"command": "git.openHEADFile",
|
||||
"when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index",
|
||||
"group": "navigation"
|
||||
},
|
||||
|
@ -543,7 +543,7 @@
|
|||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "git.openOldFile",
|
||||
"command": "git.openHEADFile",
|
||||
"when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree",
|
||||
"group": "navigation"
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"command.refresh": "Refresh",
|
||||
"command.openChange": "Open Changes",
|
||||
"command.openFile": "Open File",
|
||||
"command.openOldFile": "Open Old File",
|
||||
"command.openHEADFile": "Open File (HEAD)",
|
||||
"command.stage": "Stage Changes",
|
||||
"command.stageAll": "Stage All Changes",
|
||||
"command.stageSelectedRanges": "Stage Selected Ranges",
|
||||
|
|
|
@ -313,13 +313,12 @@ export class CommandCenter {
|
|||
return await commands.executeCommand<void>('vscode.open', uri, viewColumn);
|
||||
}
|
||||
|
||||
@command('git.openOldFile')
|
||||
async openOldFile(arg?: Resource | Uri): Promise<void> {
|
||||
@command('git.openHEADFile')
|
||||
async openHEADFile(arg?: Resource | Uri): Promise<void> {
|
||||
let resource: Resource | undefined = undefined;
|
||||
|
||||
if (arg instanceof Resource) {
|
||||
resource = arg;
|
||||
|
||||
} else if (arg instanceof Uri) {
|
||||
resource = this.getSCMResource(arg);
|
||||
} else {
|
||||
|
@ -329,17 +328,15 @@ export class CommandCenter {
|
|||
if (!resource) {
|
||||
return;
|
||||
}
|
||||
return await this._openOldResource(resource);
|
||||
}
|
||||
|
||||
private async _openOldResource(resource: Resource): Promise<void> {
|
||||
const old = this.getLeftResource(resource);
|
||||
const current = this.getRightResource(resource);
|
||||
const HEAD = this.getLeftResource(resource);
|
||||
|
||||
if (!old) {
|
||||
return await commands.executeCommand<void>('vscode.open', current);
|
||||
if (!HEAD) {
|
||||
window.showWarningMessage(localize('HEAD not available', "HEAD version of '{0}' is not available.", path.basename(resource.resourceUri.fsPath)));
|
||||
return;
|
||||
}
|
||||
return await commands.executeCommand<void>('vscode.open', old);
|
||||
|
||||
return await commands.executeCommand<void>('vscode.open', HEAD);
|
||||
}
|
||||
|
||||
@command('git.openChange')
|
||||
|
|
Loading…
Reference in a new issue