Store included grammar scopes

This commit is contained in:
Kevin Sawicki
2014-06-23 16:22:37 -07:00
parent 6aeca79d1b
commit 6336ffbf44

View File

@@ -252,9 +252,19 @@ class Atom extends Model
storeGrammarsForOpenEditors: ->
packageNames = []
for editor in @workspace.getEditors()
{packageName} = editor.getGrammar()
packageNames.push(packageName) if packageName
addGrammar = (grammar={}) ->
{includedGrammarScopes, packageName} = grammar
return unless packageName
# Prevent cycles
return if packageNames.indexOf(packageName) isnt -1
packageNames.push(packageName)
for scopeName in includedGrammarScopes ? []
console.log scopeName
addGrammar(atom.syntax.grammarForScopeName(scopeName))
addGrammar(editor.getGrammar()) for editor in @workspace.getEditors()
@state.packagesWithActiveGrammars = _.uniq(packageNames)
# Public: Get the load settings for the current window.