diff --git a/lib/autocomplete-paths.js b/lib/autocomplete-paths.js index 74922c0..e229729 100644 --- a/lib/autocomplete-paths.js +++ b/lib/autocomplete-paths.js @@ -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() })) }) diff --git a/lib/paths-cache.js b/lib/paths-cache.js index 9cb3323..ed67c38 100644 --- a/lib/paths-cache.js +++ b/lib/paths-cache.js @@ -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'),