   cancel: ->
     @editor.getSelection().insertText @originalSelectedText
     @editor.setSelectionBufferRange(@originalSelectionBufferRange)
-    @remove()
+    @detach()
 
   toggle: ->
-    if @parent()[0] then @remove() else @show()
+    if @parent()[0] then @detach() else @attach()
 
-  show: ->
+  attach: ->
+    @editor.addClass('autocomplete')
     @originalSelectedText = @editor.getSelectedText()
     @originalSelectionBufferRange = @editor.getSelection().getBufferRange()
     @buildMatchList()


  select: ->
    @editor.getSelection().clearSelection()
    @remove()
    @editor.focus()

  buildWordList: () ->

    @css {left: left, top: top + @editor.lineHeight}
    $(document.body).append(this)
    @focus()

  detach: ->
    @editor.removeClass('autocomplete')
    super

  previousMatch: ->
    previousIndex = @currentMatchIndex - 1
