       return false
 
     if @provider.showLineHeader
-      for line, row in @narrowEditor.buffer.getLines() when (row >= 1)
-        return false unless line.startsWith(@items[row]._lineHeader)
+      for line, row in @narrowEditor.buffer.getLines() when (row >= 1) and not (item = @items[row]).skip
+        return false unless line.startsWith(item._lineHeader)
 
     true
 
 
   observeInputChange: ->
-    @narrowEditor.buffer.onDidChange ({newRange, oldRange}) =>
-      if not newRange.isEmpty() and (newRange.start.row is 0) and (newRange.end.row is 0)
-        return @refresh()
-
-      if not oldRange.isEmpty() and (oldRange.start.row is 0) and (oldRange.end.row is 0)
-        return @refresh()
+    @narrowEditor.buffer.onDidChange ({newRange, oldRange, newText, oldText}) =>
+      return if @ignoreChangeOnNarrowEditor
+
+      promptRange = @getPromptRange()
+      onPrompt = (range) -> range.intersectsWith(promptRange)
+      notEmptyAndPrompt = (range) -> not range.isEmpty() and onPrompt(range)
+
+      if notEmptyAndPrompt(newRange) or notEmptyAndPrompt(oldRange)
+        if @narrowEditor.hasMultipleCursors()
+          # Destroy cursors on prompt
+          for selection in @narrowEditor.getSelections() when onPrompt(selection.getBufferRange())
+            selection.destroy()
+          @setPromptLine(@lastNarrowQuery) if @lastNarrowQuery
+        else
+          @refresh()
 
   locked: false
   isLocked: -> @locked

  @uiByNarrowEditor: new Map()
  autoPreview: false
  preventAutoPreview: false
  destroyed: false
  items: []


  appendText: (text) ->
    eof = @narrowEditor.getEofBufferPosition()
    if eof.isLessThan([1, 0])
      eof = @setPromptLine("\n").end
      @moveToPrompt()
    @narrowEditor.setTextInBufferRange([eof, eof], text)

  # Return row
