Include injection grammars in active list

Prevents an immediate flicker when restarting Atom with editors
open that have injection matches.
This commit is contained in:
Kevin Sawicki
2014-09-04 16:04:32 -07:00
parent 86e623e9db
commit 90592a70be
2 changed files with 14 additions and 3 deletions

View File

@@ -75,7 +75,13 @@ class Workspace extends Model
for scopeName in includedGrammarScopes ? []
addGrammar(atom.syntax.grammarForScopeName(scopeName))
addGrammar(editor.getGrammar()) for editor in @getTextEditors()
editors = @getTextEditors()
addGrammar(editor.getGrammar()) for editor in editors
if editors.length > 0
for grammar in atom.syntax.grammars when grammar.injectionSelector
addGrammar(grammar)
_.uniq(packageNames)
editorAdded: (editor) ->