       advanceToNextLine = false
       @patchIterator.moveToSuccessor()
 
-    return false unless @closeTags? or @openTags? or comparePoints(@startBufferPosition, @buffer.getEndPosition()) < 0
+    return false unless @closeTags.length > 0 or @openTags.length > 0 or comparePoints(@startBufferPosition, @buffer.getEndPosition()) < 0
 
     if advanceToNextLine
       @startScreenPosition = Point(@startScreenPosition.row + 1, 0)

        @patchIterator.moveToSuccessor()

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

    @assignEndPositionsAndText()
    true

  getOpenTags: -> @openTags ? EMPTY_ARRAY

  getCloseTags: -> @closeTags ? EMPTY_ARRAY

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

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