diff --git a/src/packages/spell-check/lib/spell-check-view.coffee b/src/packages/spell-check/lib/spell-check-view.coffee index 323d0e873..3f5bba2d6 100644 --- a/src/packages/spell-check/lib/spell-check-view.coffee +++ b/src/packages/spell-check/lib/spell-check-view.coffee @@ -18,7 +18,7 @@ class SpellCheckView extends View @subscribeToBuffer() - subscribeToBuffer: -> + unsubscribeFromBuffer: -> @destroyViews() @task?.abort() @@ -26,6 +26,9 @@ class SpellCheckView extends View @buffer.off '.spell-check' @buffer = null + subscribeToBuffer: -> + @unsubscribeFromBuffer() + if @spellCheckCurrentGrammar() @buffer = @editor.getBuffer() @buffer.on 'contents-modified.spell-check', => @updateMisspellings() @@ -47,6 +50,10 @@ class SpellCheckView extends View @append(view) updateMisspellings: -> + unless @editor.activeEditSession? + @unsubscribeFromBuffer() + return + @task?.abort() callback = (misspellings) =>