Use the just-loaded project settings for blacklist generation instead of relying on Settings.

This fixes #470, or at least makes it less ambiguous. It's not entirely clear where the race condition
was causing the settings to contain bad results, but this fixes the problem.
This commit is contained in:
Thomas Wilburn 2015-11-07 17:54:10 -08:00
parent 43a6eb362d
commit 74d33a4238
2 changed files with 5 additions and 4 deletions

View file

@ -163,8 +163,9 @@ define([
}); });
}; };
var blacklistRegExp = function() { var blacklistRegExp = function(config) {
var blacklist = Settings.get("user").ignoreFiles; //avoid race condition when reloading
var blacklist = (config || Settings.get("user")).ignoreFiles;
if (blacklist) { if (blacklist) {
return new RegExp(blacklist); return new RegExp(blacklist);
} }
@ -453,7 +454,7 @@ define([
this.element.addClass("loading"); this.element.addClass("loading");
//restore directory entries that can be restored //restore directory entries that can be restored
this.directories = []; this.directories = [];
blacklist = blacklistRegExp(); blacklist = blacklistRegExp(project.settings);
M.map( M.map(
project.folders, project.folders,
function(folder, index, c) { function(folder, index, c) {

View file

@ -1,7 +1,7 @@
{ {
"name": "Caret", "name": "Caret",
"description": "Professional text editing for Chrome and Chrome OS", "description": "Professional text editing for Chrome and Chrome OS",
"version": "1.6.1", "version": "1.6.2",
"manifest_version": 2, "manifest_version": 2,
"default_locale": "en", "default_locale": "en",
"icons": { "icons": {