     'filetext'
 
   toggle: ->
-    console.log 'toggle'
     if @panel?.isVisible()
       @hide()
     else

      @confirmed(item)
    else
      query = @getFilterQuery()
      if query?
        # TODO(seongjae): It should create a new document.
        console.log(query)
      @cancel()

  confirmed: (item) ->
    console.log 'confirmed #{item}'
    atom.workspace.open(item.filepath)
    @cancel()

  destroy: ->
    console.log 'destroy'
    @cancel()
    @panel?.destroy()

  show: ->
    console.log 'show'
    @storeFocusedElement()
    @panel ?= atom.workspace.addModalPanel(item: this)
    @panel.show()

    @panel?.hide()

  populateList: ->
    return unless @items?

    filterQuery = @getFilterQuery()
