       if @items.hasNormalItem()
         if (not selectFirstItem) and item = @items.findItem(oldSelectedItem)
           @items.selectItem(item)
-          if wasCursorSyncWithSelectedItem
+          if wasAtSelectedItem
             @moveToSelectedItem(ignoreCursorMove: not @isActive())
             row = @editor.getCursorBufferPosition().row
             @editor.setCursorBufferPosition([row, oldColumn])

      @items.selectItem(item)
      @moveToSelectedItem(ignoreCursorMove: false)

  moveToPromptOrSelectedItem: ->
    row = @items.getRowForSelectedItem()
    if (row is @editor.getCursorBufferPosition().row) or not (row >= 0)
      @moveToPrompt()
    else
      # move to current item
      @editor.setCursorBufferPosition([row, 0])

  moveToPrompt: ->
    @withIgnoreCursorMove =>
      @editor.setCursorBufferPosition(@getPromptRange().end)
      @setReadOnly(false)
      @emitDidMoveToPrompt()

  isPromptRow: (row) ->
    row is 0

      @grammar.update(filterSpec.include) # No need to highlight excluded items

    promiseForItems.then (items) =>
      if @excludedFiles.length
        items = items.filter ({filePath}) => filePath not in @excludedFiles
      items = @provider.filterItems(items, filterSpec)

      oldSelectedItem = @items.getSelectedItem()
      wasAtSelectedItem = @isAtSelectedItem()
      oldColumn = @editor.getCursorBufferPosition().column

      @items.setItems([@promptItem, items...])
