Only allow bundle bias if a file type was matched

This commit is contained in:
Indrek Ardel
2015-11-10 21:02:41 +02:00
parent 49f391ff81
commit 66255baa71

View File

@@ -46,7 +46,7 @@ class GrammarRegistry extends FirstMate.GrammarRegistry
contents = fs.readFileSync(filePath, 'utf8') if not contents? and fs.isFileSync(filePath)
score = @getGrammarPathScore(grammar, filePath)
if not grammar.bundledPackage
if score > 0 and not grammar.bundledPackage
score += 0.25
if @grammarMatchesContents(grammar, contents)
score += 0.125