     @spatialTokenIterator = @screenLineIndex.buildTokenIterator()
     @screenLineIterator = @screenLineIndex.buildScreenLineIterator()
     @screenLineIndex.splice(0, 0, @buildScreenLines(0, @buffer.getLineCount()))
+    @decorationIterator = new EmptyDecorationIterator
     @emitter = new Emitter
 
   destroy: ->


  getScreenLines: (startRow=0, endRow=@getScreenLineCount()) ->
    screenLines = []

    @screenLineIterator.seekToScreenRow(startRow)

    while @screenLineIterator.getScreenRow() < endRow
      bufferStart = @screenLineIterator.getBufferStart()
      tokens = []
      nextTokenCloseTags = []
      for {screenExtent, bufferExtent, metadata} in @screenLineIterator.getTokens()
        bufferEnd = traverse(bufferStart, bufferExtent)
        token = {closeTags: nextTokenCloseTags, openTags: []}
        nextTokenCloseTags = []

        if metadata?.hardTab
          if @invisibles.tab?
            token.text = @invisibles.tab + ' '.repeat(screenExtent - 1)
          else
            token.text = ' '.repeat(screenExtent)
        else if (metadata?.leadingWhitespace or metadata?.trailingWhitespace) and @invisibles.space?
          token.text = @invisibles.space.repeat(screenExtent)
        else if metadata?.fold
          token.text = '⋯'
        else if metadata?.void
          if metadata?.eol?
            token.text = metadata.eol
          else
            token.text = ' '.repeat(screenExtent)
        else
          token.text = @buffer.getTextInRange(Range(bufferStart, bufferEnd))

        if spatialDecoration = @getSpatialTokenTextDecoration(metadata)
          token.openTags.push(spatialDecoration)
          nextTokenCloseTags.push(spatialDecoration)

        tokens.push(token)
        bufferStart = bufferEnd

      if nextTokenCloseTags.length > 0
        tokens.push({text: '', closeTags: nextTokenCloseTags, openTags: []})

      screenLines.push({id: @screenLineIterator.getId(), tokens})
      break unless @screenLineIterator.moveToSuccessor()

    screenLines

  getSpatialTokenTextDecoration: (metadata) ->
    if metadata

Range = require './range'
DisplayMarkerLayer = require './display-marker-layer'
TokenIterator = require './token-iterator'
EmptyDecorationIterator = require './empty-decoration-iterator'
{traverse, traversal, clipNegativePoint} = pointHelpers = require './point-helpers'
comparePoints = pointHelpers.compare
maxPoint = pointHelpers.max
