         # apply highlighting after we deactivated it.
         editor.on 'grammar-changed', =>
           grammarIsAgda = editor.getGrammar().name is 'Agda'
-          shouldHighlight = editor.agda.passed and editor.agda.passed
+          shouldHighlight = editor.agda.loaded and editor.agda.passed
           if grammarIsAgda and not shouldHighlight
             # fuck you atom
             editor.agda.syntax.deactivate()


    atom.workspaceView.eachEditorView (editorView) =>
      editor = editorView.getModel()
      if @isAgdaFile editor
        editor.agda = new Agda editorView

        # deactivated on default

        editor.on 'became-inactive', =>
          editor.agda.emit 'deactivate'

    [
      'agda-mode:load'
      'agda-mode:quit'
      'agda-mode:restart'
      'agda-mode:next-goal'
      'agda-mode:previous-goal'
      'agda-mode:give'
      'agda-mode:goal-type'
      'agda-mode:context'
      'agda-mode:goal-type-and-context'
      'agda-mode:refine'
    ].forEach registerCommand


  deactivate: ->
