Addressing feedback

This commit is contained in:
wistcc
2018-08-08 10:31:53 -04:00
parent 06447486bb
commit 4e3f1e2a5e

View File

@@ -527,8 +527,6 @@ export class Repository implements Disposable {
private readonly repository: BaseRepository,
globalState: Memento
) {
const config = workspace.getConfiguration('git');
const gitShowStagedChangesResourceGroup = config.get<string>('showStagedChangesResourceGroup');
const fsWatcher = workspace.createFileSystemWatcher('**');
this.disposables.push(fsWatcher);
@@ -551,8 +549,11 @@ export class Repository implements Disposable {
this._indexGroup = this._sourceControl.createResourceGroup('index', localize('staged changes', "Staged Changes"));
this._workingTreeGroup = this._sourceControl.createResourceGroup('workingTree', localize('changes', "Changes"));
const onConfigListener = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.showStagedChangesResourceGroup'));
onConfigListener(this.showStagedChangesResourceGroup, this, this.disposables);
this.showStagedChangesResourceGroup();
this.mergeGroup.hideWhenEmpty = true;
this.indexGroup.hideWhenEmpty = !gitShowStagedChangesResourceGroup;
this.disposables.push(this.mergeGroup);
this.disposables.push(this.indexGroup);
@@ -651,6 +652,12 @@ export class Repository implements Disposable {
}
}
private showStagedChangesResourceGroup(): void {
const config = workspace.getConfiguration('git');
const gitShowStagedChangesResourceGroup = config.get<string>('showStagedChangesResourceGroup');
this.indexGroup.hideWhenEmpty = !gitShowStagedChangesResourceGroup;
}
@throttle
async status(): Promise<void> {
await this.run(Operation.Status);