From ab2a298994eb31625ed6083dd0bc6b4011194e10 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 23 Apr 2013 09:39:31 -0700 Subject: [PATCH] :lipstick: --- src/app/text-mate-package.coffee | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/text-mate-package.coffee b/src/app/text-mate-package.coffee index 2ea560a99..5dd006fe9 100644 --- a/src/app/text-mate-package.coffee +++ b/src/app/text-mate-package.coffee @@ -45,16 +45,18 @@ class TextMatePackage extends Package loadGrammars: (done) -> fsUtils.isDirectoryAsync @syntaxesPath, (isDirectory) => - if isDirectory - fsUtils.listAsync @syntaxesPath, @legalGrammarExtensions, (err, paths) => - return console.log("Error loading grammars of TextMate package '#{@path}':", err.stack, err) if err - async.waterfall [ - (next) => - async.eachSeries paths, @loadGrammarAtPath, next - (next) => - @loadScopedProperties() - next() - ], done + return unless isDirectory + + fsUtils.listAsync @syntaxesPath, @legalGrammarExtensions, (err, paths) => + return console.log("Error loading grammars of TextMate package '#{@path}':", err.stack, err) if err + async.waterfall [ + (next) => + async.eachSeries paths, @loadGrammarAtPath, next + (next) => + @loadScopedProperties() + next() + ], done + loadGrammarAtPath: (path, done) => TextMateGrammar.load path, (err, grammar) => return console.log("Error loading grammar at path '#{path}':", err.stack ? err) if err