       if @isFold()
         @closeTags = @containingTags.slice()
         @containingTags.length = 0
-        @openTags = null
+        @openTags = EMPTY_ARRAY
         @tagsToReopen = @decorationIterator.seek(@getEndBufferPosition())
       else
         decorationIteratorPosition = @decorationIterator.getPosition()

    @containingTags

  moveToSuccessor: ->
    if @closeTags?
      for tag in @closeTags
        @containingTags.splice(@containingTags.lastIndexOf(tag), 1)

    if @openTags?
      @containingTags.push(@openTags...)

    @startScreenPosition = @endScreenPosition
    @startBufferPosition = @endBufferPosition
    @closeTags = null
    @openTags = null

    advanceToNextLine = true
    if @decorationIterator? and isEqualPoint(@startBufferPosition, @decorationIterator.getPosition())

        @patchIterator.moveToSuccessor()

    if @tagsToReopen?
      for tag in @closeTags
        @tagsToReopen.splice(@tagsToReopen.lastIndexOf(tag), 1)
      @closeTags = EMPTY_ARRAY
      @openTags = @tagsToReopen.concat(@openTags)
      @tagsToReopen = null

    @assignEndPositionsAndText()
    true

  getOpenTags: -> @openTags

  getCloseTags: -> @closeTags

  assignEndPositionsAndText: ->
    if @patchIterator.getOutputEnd().row is @startScreenPosition.row
