       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])

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

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

      oldSelectedItem = @items.getSelectedItem()
      wasCursorSyncWithSelectedItem = not @isCursorOutOfSyncWithSelectedItem()
      oldColumn = @editor.getCursorBufferPosition().column

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

      if @query and @autoPreviewOnQueryChange
        @preview() unless previewd

  observeStopChangingActivePaneItem: ->
    atom.workspace.onDidStopChangingActivePaneItem (item) =>
      if item isnt @editor
