 
   # reducer
   # -------------------------
+  # editor scan
   renderItems: (state) =>
-    {items} = state
-    return if items.length is 0
-
-    texts = items.map (item) => @provider.viewForItem(item)
+    if not state.items.length and not state.initialRender
+      return null
+
+    texts = state.items.map (item) => @provider.viewForItem(item)
+
     @withIgnoreChange =>
       if @editor.getLastBufferRow() is 0
         @resetQuery()
 
-      itemArea = new Range(@nextRenderingPoint, @editor.getEofBufferPosition())
-
-      if @nextRenderingPoint is @itemAreaStart
-        newLineOrEmptyString = ''
+      eof = @editor.getEofBufferPosition()
+      if state.initialRender
+        range = [@itemAreaStart, eof]
+        text = '' + texts.join("\n")
       else
-        newLineOrEmptyString = "\n"
-
-      range = @editor.setTextInBufferRange(itemArea, newLineOrEmptyString + texts.join("\n"), undo: 'skip')
+        range = [eof, eof]
+        text = "\n" + texts.join("\n")
+
+      @editorLastRow = @editor.setTextInBufferRange(range, text, undo: 'skip').end.row
       @setModifiedState(false)
-      @editorLastRow = range.end.row
-    @nextRenderingPoint = @editor.getEofBufferPosition()
+
+    {initialRender: false}
 
   observeChange: ->
     @editor.buffer.onDidChange (event) =>

      onFilePathChange: => setImmediate(=> @controlBar.updateItemCount())
      allItems: []
      filterSpec: filterSpec
    }
    console.log 'hasCache', reducerState.hasCachedItems, reducerState.filterSpec.include


    resolveGetItem = null
    oldSelectedItem = null
    oldColumn = null
    grammarUpdated = false

    reducerState = {
