def reassign(self, view):
        v = view.settings()
        v.clear_on_change("checkbounce_spelling_monitor")
        on = v.get("enable_checkbounce_spelling")
        vid = view.id()

        if not vid in self.prev_syntax:
            self.prev_syntax[vid] = v.get("syntax")
        elif self.prev_syntax[vid] != v.get("syntax"):
            SpellChecker.remove(view.id())
            view.erase_status('checkbounce')
            SpellChecker.assign(view, self.finish)

        if on != self.on:
            self.on = on
            SpellChecker.remove(vid)
            sublime.set_timeout(lambda: view.erase_status('checkbounce'), 0)

            if on:
                SpellChecker.assign(view, self.finish)
                SpellChecker.reload()
            if not on:
                if vid in self.loaded:
                    self.loaded.remove(vid)
                if vid in self.checked:
                    self.checked.remove(vid)

            self.on_modified(view)

        v.add_on_change('checkbounce_spelling_monitor', lambda: self.reassign(view))
 def on_close(self, view):
     vid = view.id()
     view.settings().clear_on_change("checkbounce_spelling_monitor")
     if vid in self.loaded:
         SpellChecker.remove(vid)
         self.loaded.remove(vid)