 
   parse: =>
     @editorView.off 'cursor:moved', @onCursorMoved
+    @destroyReferenceMarkers()
     @destroyErrorMarkers()
     text = @editor.buffer.getText()
     if text isnt @cachedText

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

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

  destroyReferenceMarkers: ->
    return unless @markers?

  onParseEnd: (errors) =>
    if errors?
      @createErrorMarkers errors
    @createReferenceMarkers @ripper.find @editor.getSelectedBufferRange().start
    @editorView.off 'cursor:moved', @onCursorMoved
    @editorView.on 'cursor:moved', @onCursorMoved

