Преглед изворни кода

Fixes show more actions button on hover w/ renames

main
Eric Amodio пре 5 година
родитељ
комит
d8654c6cd1
3 измењених фајлова са 14 додато и 8 уклоњено
  1. +1
    -0
      CHANGELOG.md
  2. +10
    -5
      src/commands/showQuickCommitFileDetails.ts
  3. +3
    -3
      src/git/formatters/commitFormatter.ts

+ 1
- 0
CHANGELOG.md Прегледај датотеку

@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Fixed
- Fixes issues with the _Show More Actions_ button on the _Details_ hover not working with renamed files
- Fixes issues with the _Open File_, _Open Files_, _Open All Changes with Working Tree_, and _Apply Changes_ commands in the views not working with renamed files
- Fixes issues with the _Open File_, _Open Files_, and _Apply Changes_ command in the quick pick menus not working with renamed files
- Fixes issues with the _Show Stashed Changes_ (`gitlens.showQuickStashList`) command and multiple repositories

+ 10
- 5
src/commands/showQuickCommitFileDetails.ts Прегледај датотеку

@ -22,16 +22,14 @@ export interface ShowQuickCommitFileDetailsCommandArgs {
sha?: string;
commit?: GitCommit | GitLogCommit;
fileLog?: GitLog;
revisionUri?: string;
goBackCommand?: CommandQuickPickItem;
}
@command()
export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand {
static getMarkdownCommandArgs(sha: string): string;
static getMarkdownCommandArgs(args: ShowQuickCommitFileDetailsCommandArgs): string;
static getMarkdownCommandArgs(argsOrSha: ShowQuickCommitFileDetailsCommandArgs | string): string {
const args = typeof argsOrSha === 'string' ? { sha: argsOrSha } : argsOrSha;
static getMarkdownCommandArgs(args: ShowQuickCommitFileDetailsCommandArgs): string {
return super.getMarkdownCommandArgsCore<ShowQuickCommitFileDetailsCommandArgs>(
Commands.ShowQuickCommitFileDetails,
args
@ -66,7 +64,14 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
uri = getCommandUri(uri, editor);
if (uri == null) return undefined;
const gitUri = await GitUri.fromUri(uri);
let gitUri;
if (args.revisionUri !== undefined) {
gitUri = GitUri.fromRevisionUri(Uri.parse(args.revisionUri));
args.sha = gitUri.sha;
}
else {
gitUri = await GitUri.fromUri(uri);
}
args = { ...args };
if (args.sha === undefined) {

+ 3
- 3
src/git/formatters/commitFormatter.ts Прегледај датотеку

@ -245,9 +245,9 @@ export class CommitFormatter extends Formatter {
}
}
commands += `[\`${GlyphChars.MiddleEllipsis}\`](${ShowQuickCommitFileDetailsCommand.getMarkdownCommandArgs(
this._item.sha
)} "Show More Actions")`;
commands += `[\`${GlyphChars.MiddleEllipsis}\`](${ShowQuickCommitFileDetailsCommand.getMarkdownCommandArgs({
revisionUri: GitUri.toRevisionUri(this._item.toGitUri()).toString(true)
})} "Show More Actions")`;
return commands;
}

Loading…
Откажи
Сачувај