       prevView.addClass('selected')
       @scrollTo(prevView)
 
+  selectResult: (resultView) ->
+    @find('.selected').removeClass('selected')
+
+    isPath = resultView.hasClass('path')
+    if isPath and not resultView.hasClass('collapsed')
+      resultView = resultView.find('.search-result:first')
+    else if not isPath
+      parentView = resultView.closest('.path')
+      resultView = parentView if parentView.hasClass('collapsed')
+
+    resultView.addClass('selected')
+
   collapseResult: ->
     parent = @find('.selected').closest('.path').view()
     parent.expand(false) if parent instanceof ResultView

    @prop('scrollHeight') <= @height() + @pixelOverdraw or @prop('scrollHeight') <= @scrollBottom() + @pixelOverdraw

  selectFirstResult: ->
    @find('.selected').removeClass('selected')

    lastView = @find('.search-result:first')
    parentView = lastView.closest('.path')
    if parentView.hasClass('collapsed')
      parentView.addClass('selected')
    else
      lastView.addClass('selected')

    @scrollTop(0)

  selectLastResult: ->
    @find('.selected').removeClass('selected')

    lastView = @find('.search-result:last')
    parentView = lastView.closest('.path')
    if parentView.hasClass('collapsed')
      @scrollTo(parentView.addClass('selected'))
    else
      @scrollTo(lastView.addClass('selected'))

  selectNextResult: ->
    selectedView = @find('.selected').view()


  scrollToBottom: ->
    @renderResults(renderAll: true)
    super()

  scrollToTop: ->
    super()

  getResultView: (filePath) ->
    el = @find("[data-path=\"#{_.escapeAttribute(filePath)}\"]")
