Browse Source

Adds tracking branch into indicator

main
Eric Amodio 6 years ago
parent
commit
c42b166730
3 changed files with 5 additions and 2 deletions
  1. BIN
      images/cl-branch-upstream-indicator.png
  2. +3
    -0
      src/constants.ts
  3. +2
    -2
      src/views/commitNode.ts

BIN
images/cl-branch-upstream-indicator.png View File

Before After
Width: 477  |  Height: 177  |  Size: 20 KiB

+ 3
- 0
src/constants.ts View File

@ -74,6 +74,8 @@ export function isTextEditor(editor: TextEditor): boolean {
}
export enum GlyphChars {
AngleBracketLeftHeavy = '\u2770',
AngleBracketRightHeavy = '\u2771',
ArrowBack = '\u21a9',
ArrowDown = '\u2193',
ArrowDropRight = '\u2937',
@ -103,6 +105,7 @@ export enum GlyphChars {
MuchLessThan = '\u22D8',
Pencil = '\u270E',
Space = '\u00a0',
SpaceThin = '\u2009',
SquareWithBottomShadow = '\u274F',
SquareWithTopShadow = '\u2750',
ZeroWidthSpace = '\u200b'

+ 2
- 2
src/views/commitNode.ts View File

@ -52,7 +52,7 @@ export class CommitNode extends ExplorerRefNode {
} as ICommitFormatOptions);
if (this.trackingRef === this.commit.sha) {
label = `${GlyphChars.ArrowHeadRight} ${label}`;
label = `${GlyphChars.AngleBracketLeftHeavy}${GlyphChars.SpaceThin}${this.branch!.tracking!}${GlyphChars.SpaceThin}${GlyphChars.AngleBracketRightHeavy}${GlyphChars.ArrowHeadRight}${GlyphChars.Space} ${label}`;
}
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
@ -72,7 +72,7 @@ export class CommitNode extends ExplorerRefNode {
item.tooltip = CommitFormatter.fromTemplate(
this.commit.isUncommitted
? `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})`
: `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})\n\n\${message}`,
: `\${author} ${GlyphChars.Dash} \${id}${this.trackingRef === this.commit.sha ? ` (${this.branch!.tracking!})` : ''}\n\${ago} (\${date})\n\n\${message}`,
this.commit,
{
dataFormat: Container.config.defaultDateFormat

Loading…
Cancel
Save