     delete @renamingCursor
     # Remove all markers for renaming.
     for marker in @renamingMarkers
+      if marker.key
+        key = @editor.getTextInBufferRange marker.key.getBufferRange()
+        value = @editor.getTextInBufferRange marker.getBufferRange()
+        if key == value
+          @editor.setTextInBufferRange [marker.key.getStartBufferPosition(), marker.getStartBufferPosition()], ''
       marker.destroy()
     delete @renamingMarkers
 

    # Returns true not to abort keyboard binding.
    true

  abort: =>
    d 'abort'
    # When this editor isn't active, do nothing.
    return unless @isActive() and @renamingCursor? and @renamingMarkers?

    # Verify all cursors are in renaming markers.
    # When the cursor is out of marker at least one, abort renaming.

    # Register the markers of the references' ranges.
    # Highlight these markers.
    @renamingMarkers = for range in ranges
      marker = @editor.markBufferRange range
      marker.shorthand = range.shorthand
      marker.delimiter = range.delimiter
      marker.key = @editor.markBufferRange range.key if range.key
      @editor.decorateMarker marker, type: 'highlight', class: 'refactor-reference'
      marker

    for marker in @renamingMarkers
      if marker.shorthand
        range = marker.getBufferRange()
        origin = @editor.markBufferRange range, invalidate: 'inside'
        text = @editor.getTextInBufferRange range
        start = range.start
        @editor.setTextInBufferRange [start, start], marker.delimiter, undo: 'skip'
        key = @editor.setTextInBufferRange [start, start], text
        marker.key = @editor.markBufferRange key
        marker.setBufferRange origin.getBufferRange()

    for marker in @renamingMarkers
      @editor.addSelectionForBufferRange marker.getBufferRange()

    # Start renaming life cycle.
    @eventCursorMoved = off
    @eventCursorMoved = 'abort'
