Fixes issue where repo change wasn't fired in some cases

Consolidates repo watching into a single watcher
Adds debounce to repo changes in the custom view
This commit is contained in:
Eric Amodio
2017-09-08 18:02:43 -04:00
parent 04d2c00ebf
commit 1b7610857a
2 changed files with 12 additions and 18 deletions

View File

@@ -47,10 +47,11 @@ export class GitExplorer implements TreeDataProvider<ExplorerNode> {
commands.registerCommand('gitlens.gitExplorer.openChangedFileRevisions', this.openChangedFileRevisions, this);
commands.registerCommand('gitlens.gitExplorer.applyChanges', this.applyChanges, this);
context.subscriptions.push(this.git.onDidChangeRepo(this.onRepoChanged, this));
const repoChangedFn = Functions.debounce(this.onRepoChanged, 250);
context.subscriptions.push(this.git.onDidChangeRepo(repoChangedFn, this));
const fn = Functions.debounce(this.onActiveEditorChanged, 500);
context.subscriptions.push(window.onDidChangeActiveTextEditor(fn, this));
const editorChangedFn = Functions.debounce(this.onActiveEditorChanged, 500);
context.subscriptions.push(window.onDidChangeActiveTextEditor(editorChangedFn, this));
context.subscriptions.push(workspace.onDidChangeConfiguration(this.onConfigurationChanged, this));
this.onConfigurationChanged();