Use RootView.eachEditor to attach snippet commands

Previously the 'editor:attached' was used which would not
fire for editors already attached and so any editors
opened before the snippets package was loaded would not
have snippets enabled.
This commit is contained in:
Kevin Sawicki 2013-02-20 12:04:17 -08:00
parent c03b3fa691
commit 932f2c4603

View File

@ -12,7 +12,8 @@ module.exports =
activate: ->
window.snippets = this
@loadAll()
rootView.on 'editor:attached', (e, editor) => @enableSnippetsInEditor(editor)
rootView.eachEditor (editor) =>
@enableSnippetsInEditor(editor) if editor.attached
deactivate: ->
@loadSnippetsTask?.abort()