 _ = require 'underscore-plus'
-{View} = require 'atom'
+{View, CompositeDisposable} = require 'atom'
 MisspellingView = require './misspelling-view'
 SpellCheckTask = require './spell-check-task'
 


    if @spellCheckCurrentGrammar()
      @buffer = @editor.getBuffer()
      @subscribe @buffer, 'contents-modified', =>
        @updateMisspellings()
      @updateMisspellings()

  spellCheckCurrentGrammar: ->

    @views = []
    @task = new SpellCheckTask()

    @subscribe @editor.onDidChangePath =>
      @subscribeToBuffer()

    @subscribe @editor.onDidChangeGrammar =>
      @subscribeToBuffer()

    @subscribe atom.config.onDidChange 'editor.fontSize', =>
      @subscribeToBuffer()

    @subscribe atom.config.onDidChange 'spell-check.grammars', =>
      @subscribeToBuffer()

    @subscribeToBuffer()
