Git - fix timeline item hover rendering (#237641)

This commit is contained in:
Ladislau Szomoru
2025-01-10 14:33:10 +01:00
committed by GitHub
parent 9df82a4e49
commit c6954727db

View File

@@ -69,19 +69,20 @@ export class GitTimelineItem extends TimelineItem {
if (shortStat) {
this.tooltip.appendMarkdown(`---\n\n`);
const labels: string[] = [];
if (shortStat.insertions) {
this.tooltip.appendMarkdown(`<span style="color:var(--vscode-scmGraph-historyItemHoverAdditionsForeground);">${shortStat.insertions === 1 ?
labels.push(`<span style="color:var(--vscode-scmGraph-historyItemHoverAdditionsForeground);">${shortStat.insertions === 1 ?
l10n.t('{0} insertion{1}', shortStat.insertions, '(+)') :
l10n.t('{0} insertions{1}', shortStat.insertions, '(+)')}</span>`);
}
if (shortStat.deletions) {
this.tooltip.appendMarkdown(`,&nbsp;<span style="color:var(--vscode-scmGraph-historyItemHoverDeletionsForeground);">${shortStat.deletions === 1 ?
labels.push(`<span style="color:var(--vscode-scmGraph-historyItemHoverDeletionsForeground);">${shortStat.deletions === 1 ?
l10n.t('{0} deletion{1}', shortStat.deletions, '(-)') :
l10n.t('{0} deletions{1}', shortStat.deletions, '(-)')}</span>`);
}
this.tooltip.appendMarkdown(`\n\n`);
this.tooltip.appendMarkdown(`${labels.join(', ')}\n\n`);
}
if (hash) {