Browse Source

Fixes working/branch toggle incorrectly showing

Adds working/branch toggle before a comparision is selected
main
Eric Amodio 4 years ago
parent
commit
872104213f
2 changed files with 7 additions and 5 deletions
  1. +4
    -4
      package.json
  2. +3
    -1
      src/views/nodes/compareBranchNode.ts

+ 4
- 4
package.json View File

@ -7673,22 +7673,22 @@
},
{
"command": "gitlens.views.setBranchComparisonToWorking",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
"group": "inline@2"
},
{
"command": "gitlens.views.setBranchComparisonToBranch",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
"group": "inline@2"
},
{
"command": "gitlens.views.setBranchComparisonToWorking",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+branch\\b)/",
"group": "1_gitlens@2"
},
{
"command": "gitlens.views.setBranchComparisonToBranch",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+comparing\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
"when": "viewItem =~ /gitlens:compare:branch\\b(?=.*?\\b\\+root\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+working\\b)/",
"group": "1_gitlens@2"
},
{

+ 3
- 1
src/views/nodes/compareBranchNode.ts View File

@ -29,7 +29,7 @@ export class CompareBranchNode extends ViewNode
view: BranchesView | CommitsView | RepositoriesView,
parent: ViewNode,
public readonly branch: GitBranch,
private readonly showComparison: ViewShowBranchComparison,
private showComparison: ViewShowBranchComparison,
// Specifies that the node is shown as a root
public readonly root: boolean = false,
) {
@ -198,6 +198,8 @@ export class CompareBranchNode extends ViewNode
async setComparisonType(comparisonType: Exclude<ViewShowBranchComparison, false>) {
if (this._compareWith != null) {
await this.updateCompareWith({ ...this._compareWith, type: comparisonType });
} else {
this.showComparison = comparisonType;
}
this._children = undefined;

Loading…
Cancel
Save