瀏覽代碼

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 6 年之前
committed by Eric Amodio
父節點
當前提交
bffe2238f7
共有 3 個文件被更改,包括 13 次插入1 次删除
  1. +6
    -0
      package.json
  2. +6
    -1
      src/annotations/annotations.ts
  3. +1
    -0
      src/ui/config.ts

+ 6
- 0
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,

+ 6
- 1
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;
}

+ 1
- 0
src/ui/config.ts 查看文件

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

Loading…
取消
儲存