Changes behavior of showQuickFileHistory

Executes showQuickRepoHistory if there is no active editor
This commit is contained in:
Eric Amodio
2017-02-17 22:22:55 -05:00
parent 46039dbf24
commit 5eb4a778e8
2 changed files with 10 additions and 10 deletions

View File

@@ -15,8 +15,11 @@ export default class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, commit?: GitCommit, goBackCommand?: CommandQuickPickItem) {
if (!(uri instanceof Uri)) {
if (!editor || !editor.document) return undefined;
uri = editor.document.uri;
uri = editor && editor.document && editor.document.uri;
}
if (!uri) {
return commands.executeCommand(Commands.ShowQuickRepoHistory);
}
const gitUri = GitUri.fromUri(uri, this.git);