Changes file alt+right to be a diff on commit details quick pick

Changes file alt+right to be a diff on repo status quick pick
This commit is contained in:
Eric Amodio
2017-05-15 03:09:54 -04:00
parent 4d62e5cdad
commit d35074ecf8
6 changed files with 58 additions and 22 deletions

View File

@@ -1,8 +1,8 @@
'use strict';
import { Iterables } from '../system';
import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
import { Commands, Keyboard, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, OpenFileCommandQuickPickItem } from './common';
import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from 'vscode';
import { Commands, DiffWithWorkingCommandArgs, Keyboard, Keys, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, OpenFileCommandQuickPickItem, QuickPickItem } from './common';
import { GitService, GitStatusFile, GitUri, IGitStatus } from '../gitService';
import * as path from 'path';
@@ -25,6 +25,17 @@ export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPick
description: description
});
}
onDidPressKey(key: Keys): Promise<{} | undefined> {
return commands.executeCommand(Commands.DiffWithWorking,
this.uri,
{
showOptions: {
preserveFocus: true,
preview: false
} as TextDocumentShowOptions
} as DiffWithWorkingCommandArgs) as Promise<{} | undefined>;
}
}
export class OpenStatusFilesCommandQuickPickItem extends CommandQuickPickItem {