ソースを参照

Changes behavior of showQuickFileHistory

Executes showQuickRepoHistory if there is no active editor
main
Eric Amodio 7年前
コミット
5eb4a778e8
2個のファイルの変更10行の追加10行の削除
  1. +5
    -2
      src/commands/showQuickFileHistory.ts
  2. +5
    -8
      src/commands/showQuickRepoHistory.ts

+ 5
- 2
src/commands/showQuickFileHistory.ts ファイルの表示

@ -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);

+ 5
- 8
src/commands/showQuickRepoHistory.ts ファイルの表示

@ -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) {

読み込み中…
キャンセル
保存