Skip to content

Commit

Permalink
Fix icons reverting when changing tree-view settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Jan 2, 2017
1 parent ca93b0e commit 6648ed0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
[Unpublished]
-------------------
### Fixed
- [[`#478`][]] Occasional breakage when opening TreeView on Arch Linux
- [[`#478`][]] Occasional breakage opening `tree-view` on Arch Linux
- Icons reverted when changing certain `tree-view` settings

[`#478`]: https://github.com/DanBrooker/file-icons/issues/478

Expand Down
13 changes: 9 additions & 4 deletions lib/consumers/tree-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ class TreeView{
});
this.disposables.add(onMove);
}
const onAddPath = atom.project.onDidChangePaths(_=> this.updateRoots());
this.disposables.add(onAddPath);
this.updateRoots();
this.disposables.add(
atom.project.onDidChangePaths(_=> this.rebuild()),
atom.config.onDidChange("tree-view.hideIgnoredNames", _=> this.rebuild()),
atom.config.onDidChange("tree-view.hideVcsIgnoredFiles", _=> this.rebuild()),
atom.config.onDidChange("tree-view.squashDirectoryNames", _=> this.rebuild()),
atom.config.onDidChange("tree-view.sortFoldersBeforeFiles", _=> this.rebuild())
);
this.rebuild();
})
);
}
Expand Down Expand Up @@ -116,7 +121,7 @@ class TreeView{



updateRoots(){
rebuild(){
for(const root of this.element.roots)
this.track(root.directory);
}
Expand Down

0 comments on commit 6648ed0

Please sign in to comment.