diff --git a/src/packages/spell-check/lib/spell-check.coffee b/src/packages/spell-check/lib/spell-check.coffee index 2465b22df..9256e6c3c 100644 --- a/src/packages/spell-check/lib/spell-check.coffee +++ b/src/packages/spell-check/lib/spell-check.coffee @@ -9,10 +9,10 @@ module.exports = ] activate: -> - if syntax.grammars.length > 1 - @subscribeToEditors() - else - syntax.on 'grammars-loaded', => @subscribeToEditors() + syntax.on 'grammars-loaded.spell-check', => @subscribeToEditors() + + deactivate: -> + syntax.off '.spell-check' subscribeToEditors: -> rootView.eachEditor (editor) -> diff --git a/src/packages/spell-check/spec/spell-check-spec.coffee b/src/packages/spell-check/spec/spell-check-spec.coffee index 0756dbdeb..6ccf41df5 100644 --- a/src/packages/spell-check/spec/spell-check-spec.coffee +++ b/src/packages/spell-check/spec/spell-check-spec.coffee @@ -8,6 +8,7 @@ describe "Spell check", -> rootView.open('sample.js') config.set('spell-check.grammars', []) window.loadPackage('spell-check', activateImmediately: true) + syntax.trigger 'grammars-loaded' rootView.attachToDom() editor = rootView.getActiveView()