mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-15 01:25:42 -05:00
Changes behavior of showQuickFileHistory
Executes showQuickRepoHistory if there is no active editor
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
'use strict';
|
||||
import { commands, Uri, window } from 'vscode';
|
||||
import { Command } from './commands';
|
||||
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||
import { ActiveEditorCommand } from './commands';
|
||||
import { Commands } from '../constants';
|
||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||
import { Logger } from '../logger';
|
||||
import { CommandQuickPickItem } from './quickPickItems';
|
||||
import { RepoCommitsQuickPick } from './quickPicks';
|
||||
|
||||
export default class ShowQuickRepoHistoryCommand extends Command {
|
||||
export default class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
|
||||
|
||||
constructor(private git: GitProvider, public repoPath: string) {
|
||||
super(Commands.ShowQuickRepoHistory);
|
||||
}
|
||||
|
||||
async execute(uri?: Uri, maxCount?: number, commit?: GitCommit, goBackCommand?: CommandQuickPickItem) {
|
||||
async execute(editor: TextEditor, uri?: Uri, maxCount?: number, commit?: GitCommit, goBackCommand?: CommandQuickPickItem) {
|
||||
if (!(uri instanceof Uri)) {
|
||||
const document = window.activeTextEditor && window.activeTextEditor.document;
|
||||
if (document) {
|
||||
uri = document.uri;
|
||||
}
|
||||
uri = editor && editor.document && editor.document.uri;
|
||||
}
|
||||
|
||||
if (maxCount == null) {
|
||||
|
||||
Reference in New Issue
Block a user