     @nextMarkerId = 0
     @destroyed = false
 
+  # Public: Remove the {MarkerLayer} from the {TextBuffer}
   destroy: ->
     @destroyed = true
     @delegate.markerLayerDestroyed(this)

      result.push(marker) if marker.matchesParams(params)
    result.sort (a, b) -> a.compare(b)

  markRange: (range, options={}) ->
    @createMarker(@delegate.clipRange(range), Marker.extractParams(options))

  markPosition: (position, options={}) ->
    options.tailed ?= false
    position = @delegate.clipPosition(position)
    @markRange(new Range(position, position), options)

  splice: (start, oldExtent, newExtent) ->
    end = start.traverse(oldExtent)

      result[id].range = Range.deserialize(markerSnapshot.range)
    result

  ###
  Section: Lifecycle
  ###

  constructor: (@delegate, @id) ->
    @index = new MarkerIndex
    @markersById = {}
