     @editor.bufferRangeForBufferRow(0)
 
   # Return range
-  setPromptLine: (text) ->
+  setPrompt: (text='') ->
+    if @editor.getLastBufferRow() is 0
+      text += "\n"
     @ignoreChangeOnEditor = true
     range = @editor.setTextInBufferRange(@getPromptRange(0), text)
     @ignoreChangeOnEditor = false

  destroyed: false
  items: []
  itemsByProvider: null # Used to cache result

  onDidMoveToPrompt: (fn) -> @emitter.on('did-move-to-prompt', fn)
  emitDidMoveToPrompt: -> @emitter.emit('did-move-to-prompt')

          for selection in @editor.getSelections() when onPrompt(selection.getBufferRange())
            selection.destroy()
          # Recover query on prompt
          @setPrompt(@lastNarrowQuery)
        else
          @refresh()

