   createFold: (startRow, endRow) ->
     foldMarker =
       @findFoldMarker({startRow, endRow}) ?
-        @buffer.markRange([[startRow, 0], [endRow, Infinity]], @foldMarkerAttributes())
+        @buffer.markRange([[startRow, 0], [endRow, Infinity]], @getFoldMarkerAttributes())
     @foldForMarker(foldMarker)
 
   isFoldedAtBufferRow: (bufferRow) ->

        @longestScreenRow = maxLengthCandidatesStartRow + screenRow
        @maxLineLength = length

  handleMarkersUpdated: =>
    if event = @pendingChangeEvent
      @pendingChangeEvent = null
      @triggerChanged(event, false)

  handleMarkerCreated: (marker) =>
    new Fold(this, marker) if marker.matchesAttributes(@foldMarkerAttributes())
    @trigger 'marker-created', @getMarker(marker.id)

  foldForMarker: (marker) ->
    @foldsByMarkerId[marker.id]

    @updateAllScreenLines()
    @tokenizedBuffer.on 'grammar-changed', (grammar) => @trigger 'grammar-changed', grammar
    @tokenizedBuffer.on 'changed', @handleTokenizedBufferChange
    @subscribe @buffer, 'markers-updated', @handleBufferMarkersUpdated
    @subscribe @buffer, 'marker-created', @handleBufferMarkerCreated

  serialize: -> @state.clone()
  getState: -> @state
