diff --git a/package.json b/package.json index 95b2e14..e7dd55c 100644 --- a/package.json +++ b/package.json @@ -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, diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index e9100c3..38180a1 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -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; } diff --git a/src/ui/config.ts b/src/ui/config.ts index 14f62aa..132d633 100644 --- a/src/ui/config.ts +++ b/src/ui/config.ts @@ -322,6 +322,7 @@ export interface IConfig { over: 'line' | 'annotation' }; + avatars: boolean; enabled: boolean; };