瀏覽代碼

Fixes GitLens view refreshing

main
Eric Amodio 6 年之前
父節點
當前提交
26856a6a6a
共有 2 個文件被更改,包括 19 次插入12 次删除
  1. +18
    -12
      src/views/gitExplorer.ts
  2. +1
    -0
      src/views/resultsExplorer.ts

+ 18
- 12
src/views/gitExplorer.ts 查看文件

@ -74,6 +74,7 @@ export class GitExplorer extends Disposable implements TreeDataProvider
if (!initializing &&
!configuration.changed(e, configuration.name('gitExplorer').value) &&
!configuration.changed(e, configuration.name('explorers').value) &&
!configuration.changed(e, configuration.name('defaultGravatarsStyle').value)) return;
if (initializing || configuration.changed(e, configuration.name('gitExplorer')('enabled').value)) {
@ -84,22 +85,27 @@ export class GitExplorer extends Disposable implements TreeDataProvider
this.setAutoRefresh(Container.config.gitExplorer.autoRefresh);
}
let view = this.config.view;
if (view === GitExplorerView.Auto) {
view = Container.context.workspaceState.get<GitExplorerView>(WorkspaceState.GitExplorerView, GitExplorerView.Repository);
}
let view = this._view;
if (initializing) {
this._view = view;
setCommandContext(CommandContext.GitExplorerView, this._view);
if (initializing || configuration.changed(e, configuration.name('gitExplorer')('view').value)) {
view = this.config.view;
if (view === GitExplorerView.Auto) {
view = Container.context.workspaceState.get<GitExplorerView>(WorkspaceState.GitExplorerView, GitExplorerView.Repository);
}
this.setRoot(await this.getRootNode(window.activeTextEditor));
if (initializing) {
this._view = view;
setCommandContext(CommandContext.GitExplorerView, this._view);
this._disposable = window.registerTreeDataProvider('gitlens.gitExplorer', this);
}
else {
this.reset(view);
this.setRoot(await this.getRootNode(window.activeTextEditor));
this._disposable = window.registerTreeDataProvider('gitlens.gitExplorer', this);
return;
}
}
this.reset(view!);
}
private onRepositoriesChanged() {

+ 1
- 0
src/views/resultsExplorer.ts 查看文件

@ -54,6 +54,7 @@ export class ResultsExplorer extends Disposable implements TreeDataProvider
if (!initializing &&
!configuration.changed(e, configuration.name('resultsExplorer').value) &&
!configuration.changed(e, configuration.name('explorers').value) &&
!configuration.changed(e, configuration.name('defaultGravatarsStyle').value)) return;
if (!initializing && this._roots.length !== 0) {

Loading…
取消
儲存