 
   onParseEnd: (errors) =>
     if errors?
-      @createErrorMarkers errors
-    @createReferenceMarkers @ripper.find @editor.getSelectedBufferRange().start
+      @createErrors errors
+    @createReferences()
     @editorView.off 'cursor:moved', @onCursorMoved
     @editorView.on 'cursor:moved', @onCursorMoved
 
-  destroyErrorMarkers: ->
+  destroyErrors: ->
     return unless @errorMarkers?
     for marker in @errorMarkers
       marker.destroy()
-
-  createErrorMarkers: (errors) =>
+    delete @errorMarkers
+
+  createErrors: (errors) =>
     @errorMarkers = for { location, range, message } in errors
       if location? #TODO deprecate verification of the location in v0.4
         range = locationDataToRange location

    @cursorMovedTimeoutId = setTimeout @onCursorMovedAfter, 0

  onCursorMovedAfter: =>
    @destroyReferenceMarkers()
    @createReferenceMarkers @ripper.find @editor.getSelectedBufferRange().start


  ###

      @editor.decorateMarker marker, type: 'gutter', class: 'refactor-error'
      marker

  destroyReferences: ->
    delete @references
    return unless @markers?
    for marker in @markers
      marker.destroy()
    delete @markers

  createReferences: ->
    @references = @ripper.find @editor.getSelectedBufferRange().start
    @markers = for range in @references
      marker = @editor.markBufferRange range
      @editor.decorateMarker marker, type: 'highlight', class: 'refactor-reference'
      marker
