 path = require 'path'
 {CompositeDisposable} = require 'atom'
 
-createLabelElement = (labelChar, className=null) ->
+createLabel = (labelChar, className) ->
   element = document.createElement("div")
   element.classList.add("choose-pane")
   element.classList.add(className) if className
   element.textContent = labelChar
   element
 
-removeLabelElemnts = ->
+removeLabels = ->
   for element in document.querySelectorAll("div.choose-pane")
     element.remove()
 

    focusedElement = document.activeElement
    restoreFocus = -> focusedElement?.focus()

    @input.readInput().then (char) =>
      if target = targetByLabel[char.toLowerCase()]
        focusTarget(target)
      else
        restoreFocus()
      removeLabelElemnts()
    .catch =>
      restoreFocus()
      removeLabelElemnts()

        when isFocused(target) then 'active'
        when target is lastFocusedTarget then 'last-focused'

      label = createLabel(labelChar, className)
      getView(target).appendChild(label)
      targetByLabel[labelChar.toLowerCase()] = target

    # Special label used for focus-last-focused
