Skip to content

Commit

Permalink
fix: update provider config on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 11, 2020
1 parent d2c105e commit ebbfea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/autocomplete-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ export default {
'core.excludeVcsIgnoredPaths',
'autocomplete-paths.ignoreSubmodules',
'autocomplete-paths.ignoredNames',
'autocomplete-paths.ignoredPatterns'
'autocomplete-paths.ignoredPatterns',
'autocomplete-paths.maxFileCount'
]
cacheOptions.forEach(cacheOption => {
this.subscriptions.add(atom.config.observe(cacheOption, value => {
if (!this._provider) return
this._provider.updateConfig()
this._provider.rebuildCache()
}))
})
Expand Down
4 changes: 4 additions & 0 deletions lib/paths-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default class PathsCache extends EventEmitter {
this._filePathsByDirectory = new Map()
this._fileWatchersByDirectory = new Map()

this.updateConfig()
}

updateConfig() {
this.config = {
excludeVcsIgnoredPaths: atom.config.get('core.excludeVcsIgnoredPaths'),
ignoreSubmodules: atom.config.get('autocomplete-paths.ignoreSubmodules'),
Expand Down

0 comments on commit ebbfea1

Please sign in to comment.