 
   registerEvents: ->
     console.log 'Registering events...'
-    # Updates the prediction model.
-    # Invoked 300ms after last buffer change.
+    # Updates the prediction model. Invoked 300ms after last buffer change.
     # TODO: use `onDidChange` instead?
     @editor.onDidStopChanging =>
+      return @resetChangeIgnorance() if @lastChangeWasPredictionInsert
 
       text = @getTextForCursorContext()
 

      console.log show_text_for: @predictionList.current()

    @subscribeToCommand @editorView, 'gamboge:complete', =>
    @subscribeToCommand @editorView, 'gamboge:complete-all', =>

    @subscribeToCommand @editorView, 'gamboge:next-prediction', =>
      @predictionList.next()

  buffer: null
  $ghostText: null

  lastChangeWasPredictionInsert: false
  predictionMarker: null

  # The model.
