diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 725db60..84b5e49 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -1703,7 +1703,9 @@ async function getShowCommitOrStashFileStepItems< const file = state.reference.files.find(f => f.fileName === state.fileName); if (file == null) return []; - const items: CommandQuickPickItem[] = [new CommitFilesQuickPickItem(state.reference)]; + const items: CommandQuickPickItem[] = [ + new CommitFilesQuickPickItem(state.reference, undefined, GitUri.getFormattedFilename(state.fileName)), + ]; let remotes: GitRemote[] | undefined; diff --git a/src/quickpicks/commitQuickPickItems.ts b/src/quickpicks/commitQuickPickItems.ts index e1868b1..6e754a1 100644 --- a/src/quickpicks/commitQuickPickItems.ts +++ b/src/quickpicks/commitQuickPickItems.ts @@ -2,6 +2,7 @@ import * as paths from 'path'; import { QuickPickItem, window } from 'vscode'; import { Commands, GitActions, OpenChangedFilesCommandArgs } from '../commands'; +import { GlyphChars } from '../constants'; import { Container } from '../container'; import { CommitFormatter, GitFile, GitLogCommit, GitStatusFile } from '../git/git'; import { Keys } from '../keyboard'; @@ -9,13 +10,15 @@ import { CommandQuickPickItem } from './quickPicksItems'; import { Strings } from '../system'; export class CommitFilesQuickPickItem extends CommandQuickPickItem { - constructor(readonly commit: GitLogCommit, picked: boolean = true) { + constructor(readonly commit: GitLogCommit, picked: boolean = true, fileName?: string) { super( { label: commit.getShortMessage(), // eslint-disable-next-line no-template-curly-in-string description: CommitFormatter.fromTemplate('${author}, ${ago} $(git-commit) ${id}', commit), - detail: `$(files) ${commit.getFormattedDiffStatus({ expand: true, separator: ', ' })}`, + detail: `$(files) ${commit.getFormattedDiffStatus({ expand: true, separator: ', ' })}${ + fileName ? `${Strings.pad(GlyphChars.Dot, 2, 2)}${fileName}` : '' + }`, picked: picked, }, undefined,