ソースを参照

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;
};

読み込み中…
キャンセル
保存