   if editor?
     GrammarListView = require './grammar-list-view'
     grammarListView ?= new GrammarListView(editor)
-  grammarListView.attach()
+  grammarListView.toggle()
 
 createGrammarStatusView = ->
   statusBar = atom.views.getView(atom.workspace).querySelector("status-bar")

      default: true

  activate: ->
    @commandDisposable = atom.commands.add('atom-text-editor', 'grammar-selector:show', createGrammarListView)
    atom.packages.onDidActivateAll(createGrammarStatusView)

  deactivate: ->
    @commandDisposable.dispose()
    grammarStatusView?.destroy()
    grammarStatusView = null
    grammarListView?.destroy()
    grammarListView = null


commandDisposable = null
grammarListView = null
grammarStatusView = null

