       @emitDidRefresh()
       @emitDidStopRefreshing()
 
+  refreshManually: (options) ->
+    @emitWillRefreshManually()
+    @refresh(options)
+
   renderItems: (items) ->
     texts = items.map (item) => @provider.viewForItem(item)
     @withIgnoreChange =>

      @excludedFiles = []
      @refresh()

  refreshManually: (options) ->
    @emitWillRefreshManually()
    @refresh(options)

  getItems: ({force, filePath}) ->
    if @cachedItems? and not force
      Promise.resolve(@cachedItems)

          @controlBar.show() if selectionDestroyed
          @withIgnoreChange => @setQuery(@lastQuery) # Recover query
        else
          autoPreview = @autoPreviewOnQueryChange and @isActive()
          # To avoid frequent refresh interferinig smooth-query-input, delay refresh.
          if autoPreview and not @provider.boundToSingleFile
            refreshDelay = 150
          else
            refreshDelay = 10
          @refreshAfter(refreshDelay, autoPreview)
      else
        @setModifiedState(true)

  # Delayed-refresh on query-change event, dont use this for other purpose.
  refreshAfter: (delay, autoPreview) ->
    @cancelDelayedRefresh()
    refreshThenPreview = =>
      @refresh(selectFirstItem: true).then =>
        @preview() if autoPreview
    @delayedRefreshTimeout = setTimeout(refreshThenPreview, delay)

  cancelDelayedRefresh: ->
    if @delayedRefreshTimeout?
      clearTimeout(@delayedRefreshTimeout)
      @delayedRefreshTimeout = null

  observeCursorMove: ->
    @editor.onDidChangeCursorPosition (event) =>
