Skip to content

Commit c42b166

Browse files
committed
Adds tracking branch into indicator
1 parent d9174de commit c42b166

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
20.5 KB
Loading

src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export function isTextEditor(editor: TextEditor): boolean {
7474
}
7575

7676
export enum GlyphChars {
77+
AngleBracketLeftHeavy = '\u2770',
78+
AngleBracketRightHeavy = '\u2771',
7779
ArrowBack = '\u21a9',
7880
ArrowDown = '\u2193',
7981
ArrowDropRight = '\u2937',
@@ -103,6 +105,7 @@ export enum GlyphChars {
103105
MuchLessThan = '\u22D8',
104106
Pencil = '\u270E',
105107
Space = '\u00a0',
108+
SpaceThin = '\u2009',
106109
SquareWithBottomShadow = '\u274F',
107110
SquareWithTopShadow = '\u2750',
108111
ZeroWidthSpace = '\u200b'

src/views/commitNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class CommitNode extends ExplorerRefNode {
5252
} as ICommitFormatOptions);
5353

5454
if (this.trackingRef === this.commit.sha) {
55-
label = `${GlyphChars.ArrowHeadRight} ${label}`;
55+
label = `${GlyphChars.AngleBracketLeftHeavy}${GlyphChars.SpaceThin}${this.branch!.tracking!}${GlyphChars.SpaceThin}${GlyphChars.AngleBracketRightHeavy}${GlyphChars.ArrowHeadRight}${GlyphChars.Space} ${label}`;
5656
}
5757
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
5858

@@ -72,7 +72,7 @@ export class CommitNode extends ExplorerRefNode {
7272
item.tooltip = CommitFormatter.fromTemplate(
7373
this.commit.isUncommitted
7474
? `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})`
75-
: `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})\n\n\${message}`,
75+
: `\${author} ${GlyphChars.Dash} \${id}${this.trackingRef === this.commit.sha ? ` (${this.branch!.tracking!})` : ''}\n\${ago} (\${date})\n\n\${message}`,
7676
this.commit,
7777
{
7878
dataFormat: Container.config.defaultDateFormat

0 commit comments

Comments
 (0)