Quellcode durchsuchen

Changes ⟷ placement to be after mini diff

main
Eric Amodio vor 6 Jahren
Ursprung
Commit
4e1e52f51c
2 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
  1. +4
    -4
      src/views/branchNode.ts
  2. +4
    -4
      src/views/statusNode.ts

+ 4
- 4
src/views/branchNode.ts Datei anzeigen

@ -60,12 +60,12 @@ export class BranchNode extends ExplorerRefNode {
async getTreeItem(): Promise<TreeItem> {
let name = this.label;
let tooltip = `${this.branch.getName()}${this.branch!.current ? ' (current)' : ''}`;
let tooltip = `${this.branch.getName()}${this.current ? ' (current)' : ''}`;
let iconSuffix = '';
if (!this.branch.remote && this.branch.tracking !== undefined) {
if (this.explorer.config.showTrackingBranch) {
name += ` ${GlyphChars.Space}${GlyphChars.ArrowLeftRightLong}${this.branch.getTrackingStatus({ prefix: `${GlyphChars.Space} ` })}${GlyphChars.Space} ${this.branch.tracking}`;
name += `${this.branch.getTrackingStatus({ prefix: `${GlyphChars.Space} ` })}${GlyphChars.Space} ${GlyphChars.ArrowLeftRightLong}${GlyphChars.Space} ${this.branch.tracking}`;
}
tooltip += `\n\nTracking ${GlyphChars.Dash} ${this.branch.tracking}\n${this.branch.getTrackingStatus({ empty: 'up-to-date', expand: true, separator: '\n' })}`;
@ -79,13 +79,13 @@ export class BranchNode extends ExplorerRefNode {
}
}
const item = new TreeItem(`${this.branch!.current ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${name}`, TreeItemCollapsibleState.Collapsed);
const item = new TreeItem(`${this.current ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${name}`, TreeItemCollapsibleState.Collapsed);
item.tooltip = tooltip;
if (this.branch.remote) {
item.contextValue = ResourceType.RemoteBranch;
}
else if (this.branch.current) {
else if (this.current) {
item.contextValue = !!this.branch.tracking
? ResourceType.CurrentBranchWithTracking
: ResourceType.CurrentBranch;

+ 4
- 4
src/views/statusNode.ts Datei anzeigen

@ -48,7 +48,7 @@ export class StatusNode extends ExplorerNode {
return this.children;
}
async getTreeItem(): Promise < TreeItem > {
async getTreeItem(): Promise<TreeItem> {
if (this.disposable !== undefined) {
this.disposable.dispose();
this.disposable = undefined;
@ -69,13 +69,13 @@ export class StatusNode extends ExplorerNode {
let hasChildren = false;
const hasWorkingChanges = status.files.length !== 0 && this.includeWorkingTree;
let label = `${status.getUpstreamStatus({ prefix: `${GlyphChars.Space} ` })}${hasWorkingChanges ? status.getDiffStatus({ prefix: `${GlyphChars.Space} `}) : ''}`;
let label = `${status.getUpstreamStatus({ prefix: `${GlyphChars.Space} ` })}${hasWorkingChanges ? status.getDiffStatus({ prefix: `${GlyphChars.Space} ` }) : ''}`;
let tooltip = `${status.branch} (current)`;
let iconSuffix = '';
if (status.upstream) {
if (this.explorer.config.showTrackingBranch) {
label += `${GlyphChars.Space} ${status.upstream}`;
label += `${GlyphChars.Space} ${GlyphChars.ArrowLeftRightLong}${GlyphChars.Space} ${status.upstream}`;
}
tooltip += `\n\nTracking ${GlyphChars.Dash} ${status.upstream}\n${status.getUpstreamStatus({ empty: 'up-to-date', expand: true, separator: '\n' })}`;
@ -105,7 +105,7 @@ export class StatusNode extends ExplorerNode {
state = TreeItemCollapsibleState.None;
}
const item = new TreeItem(label, state);
const item = new TreeItem(`${status.branch}${label}`, state);
item.id = this.id;
item.contextValue = ResourceType.Status;
item.tooltip = tooltip;

Laden…
Abbrechen
Speichern