Parcourir la source

Add the gitlens.hovers.avatars configuration option

This setting allows disabling/enabling showing avatars in hovers. We
already have settings for the explorer and blame gutter, so it makes
sense to also have one for the hovers.
main
Segev Finer il y a 6 ans
committed by Eric Amodio
Parent
révision
bffe2238f7
3 fichiers modifiés avec 13 ajouts et 1 suppressions
  1. +6
    -0
      package.json
  2. +6
    -1
      src/annotations/annotations.ts
  3. +1
    -0
      src/ui/config.ts

+ 6
- 0
package.json Voir le fichier

@ -599,6 +599,12 @@
"description": "Specifies when to trigger hovers for the current line\n `annotation` - only shown when hovering over the line annotation\n `line` - shown when hovering anywhere over the line",
"scope": "window"
},
"gitlens.hovers.avatars": {
"type": "boolean",
"default": true,
"description": "Specifies whether to show avatar images in hovers",
"scope": "window"
},
"gitlens.hovers.enabled": {
"type": "boolean",
"default": true,

+ 6
- 1
src/annotations/annotations.ts Voir le fichier

@ -96,6 +96,7 @@ export class Annotations {
let message = '';
let commandBar = '';
let showCommitDetailsCommand = '';
let avatar = '';
if (!commit.isUncommitted) {
commandBar = `\n\n${this.getHoverCommandBar(commit, remotes.length !== 0, annotationType, line)}`;
showCommitDetailsCommand = `[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details")`;
@ -121,7 +122,11 @@ export class Annotations {
showCommitDetailsCommand = `\`${commit.shortSha === 'working' ? '00000000' : commit.shortSha}\``;
}
const markdown = new MarkdownString(`${showCommitDetailsCommand}   ![](${commit.getGravatarUri(Container.config.defaultGravatarsStyle).toString()})  __${commit.author}__, ${commit.fromNow()}   _(${commit.formatDate(dateFormat)})_ ${message}${commandBar}`);
if (Container.config.hovers.avatars) {
avatar = `   ![](${commit.getGravatarUri(Container.config.defaultGravatarsStyle).toString()})`;
}
const markdown = new MarkdownString(`${showCommitDetailsCommand}${avatar}  __${commit.author}__, ${commit.fromNow()}   _(${commit.formatDate(dateFormat)})_ ${message}${commandBar}`);
markdown.isTrusted = true;
return markdown;
}

+ 1
- 0
src/ui/config.ts Voir le fichier

@ -322,6 +322,7 @@ export interface IConfig {
over: 'line' | 'annotation'
};
avatars: boolean;
enabled: boolean;
};

Chargement…
Annuler
Enregistrer