Explorar el Código

Changes Show Commit Details to Open Commit Details

Adds Open Details to commits & stashes in views
main
Eric Amodio hace 2 años
padre
commit
69f74e44d5
Se han modificado 6 ficheros con 24 adiciones y 12 borrados
  1. +15
    -4
      package.json
  2. +1
    -1
      src/commands/quickCommand.buttons.ts
  3. +1
    -1
      src/commands/showCommitsInView.ts
  4. +1
    -0
      src/constants.ts
  5. +5
    -5
      src/git/formatters/commitFormatter.ts
  6. +1
    -1
      src/quickpicks/items/commits.ts

+ 15
- 4
package.json Ver fichero

@ -145,6 +145,7 @@
"onCommand:gitlens.showCommitSearch",
"onCommand:gitlens.revealCommitInView",
"onCommand:gitlens.showCommitInView",
"onCommand:gitlens:showInDetailsView",
"onCommand:gitlens.showCommitsInView",
"onCommand:gitlens.showFileHistoryInView",
"onCommand:gitlens.openFileHistory",
@ -4532,7 +4533,13 @@
},
{
"command": "gitlens.showCommitInView",
"title": "Show Commit Details",
"title": "Open Commit Details",
"category": "GitLens",
"icon": "$(eye)"
},
{
"command": "gitlens.showInDetailsView",
"title": "Open Details",
"category": "GitLens",
"icon": "$(eye)"
},
@ -7030,6 +7037,10 @@
"when": "gitlens:activeFileStatus =~ /blameable/"
},
{
"command": "gitlens.showInDetailsView",
"when": "false"
},
{
"command": "gitlens.showCommitsInView",
"when": "gitlens:activeFileStatus =~ /blameable/"
},
@ -9875,8 +9886,8 @@
"group": "2_gitlens_quickopen@1"
},
{
"command": "gitlens.showCommitInView",
"when": "viewItem =~ /gitlens:commit\\b/",
"command": "gitlens.showInDetailsView",
"when": "viewItem =~ /gitlens:(commit|stash)\\b/",
"group": "3_gitlens_explore@0"
},
{
@ -11086,7 +11097,7 @@
"group": "navigation@1"
},
{
"command": "gitlens.showCommitInView",
"command": "gitlens.showInDetailsView",
"when": "view =~ /gitlens\\.views\\.(fileHistory|lineHistory\\b)/ && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/",
"group": "navigation@2"
},

+ 1
- 1
src/commands/quickCommand.buttons.ts Ver fichero

@ -115,7 +115,7 @@ export namespace QuickCommandButtons {
export const ShowDetailsView: QuickInputButton = {
iconPath: new ThemeIcon('eye'),
tooltip: 'Show Details',
tooltip: 'Open Details',
};
export const RevealInSideBar: QuickInputButton = {

+ 1
- 1
src/commands/showCommitsInView.ts Ver fichero

@ -26,7 +26,7 @@ export class ShowCommitsInViewCommand extends ActiveEditorCommand {
}
constructor(private readonly container: Container) {
super([Commands.ShowCommitInView, Commands.ShowCommitsInView]);
super([Commands.ShowCommitInView, Commands.ShowInDetailsView, Commands.ShowCommitsInView]);
}
protected override preExecute(context: CommandContext, args?: ShowCommitsInViewCommandArgs) {

+ 1
- 0
src/constants.ts Ver fichero

@ -170,6 +170,7 @@ export const enum Commands {
ShowHomeView = 'gitlens.showHomeView',
ShowFileHistoryView = 'gitlens.showFileHistoryView',
ShowInCommitGraph = 'gitlens.showInCommitGraph',
ShowInDetailsView = 'gitlens.showInDetailsView',
ShowLastQuickPick = 'gitlens.showLastQuickPick',
ShowLineHistoryView = 'gitlens.showLineHistoryView',
ShowQuickBranchHistory = 'gitlens.showQuickBranchHistory',

+ 5
- 5
src/git/formatters/commitFormatter.ts Ver fichero

@ -371,7 +371,7 @@ export class CommitFormatter extends Formatter {
)}\`](${ShowCommitsInViewCommand.getMarkdownCommandArgs(
this._item.sha,
this._item.repoPath,
)} "Show Details")`;
)} "Open Details")`;
commands += `  [$(chevron-left)$(compare-changes)](${DiffWithCommand.getMarkdownCommandArgs({
lhs: {
@ -400,7 +400,7 @@ export class CommitFormatter extends Formatter {
)}\`](${ShowCommitsInViewCommand.getMarkdownCommandArgs(
this._item.sha,
this._item.repoPath,
)} "Show Details")`;
)} "Open Details")`;
}
return commands;
@ -411,7 +411,7 @@ export class CommitFormatter extends Formatter {
commands = `---\n\n[\`$(git-commit) ${this.id}\`](${ShowCommitsInViewCommand.getMarkdownCommandArgs(
this._item.sha,
this._item.repoPath,
)} "Show Details")`;
)} "Open Details")`;
commands += `  [$(chevron-left)$(compare-changes)](${DiffWithCommand.getMarkdownCommandArgs(
this._item,
@ -586,7 +586,7 @@ export class CommitFormatter extends Formatter {
link = `[\`$(git-commit) ${sha}\`](${ShowCommitsInViewCommand.getMarkdownCommandArgs(
this._item.sha,
this._item.repoPath,
)} "Show Details")`;
)} "Open Details")`;
break;
}
case 'html': {
@ -594,7 +594,7 @@ export class CommitFormatter extends Formatter {
link = /*html*/ `<a href="${ShowCommitsInViewCommand.getMarkdownCommandArgs(
this._item.sha,
this._item.repoPath,
)}" title="Show Details"${
)}" title="Open Details"${
this._options.htmlFormat?.classes?.link ? ` class="${this._options.htmlFormat.classes.link}"` : ''
}><span class="codicon codicon-git-commit"></span>${sha}</a>`;
break;

+ 1
- 1
src/quickpicks/items/commits.ts Ver fichero

@ -255,7 +255,7 @@ export class CommitOpenDirectoryCompareWithWorkingCommandQuickPickItem extends C
export class CommitOpenDetailsCommandQuickPickItem extends CommandQuickPickItem {
constructor(private readonly commit: GitCommit, item?: QuickPickItem) {
super(item ?? '$(eye) Show Details');
super(item ?? '$(eye) Open Details');
}
override execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {

Cargando…
Cancelar
Guardar