     }
     true
 
+  # Private: Updates the interval index on the marker manager with the marker's
+  # current range.
   updateIntervals: ->
     @manager.intervals.update(@id, @range.start, @range.end)


    @update(params)

  getStartPosition: ->
    if @reversed
      @getHeadPosition()
    else
      @getTailPosition()

  getEndPosition: ->
    if @reversed
      @getTailPosition()
    else
      @getHeadPosition()

  clearTail: (params) ->
    params = @extractParams(params)
    params.tailed = false
    headPosition = @getHeadPosition()
    params.range = new Range(headPosition, headPosition)
    @update(params)

  plantTail: (params) ->
    params = @extractParams(params)
    unless @hasTail()
      params.tailed = true
      params.range = new Range(@getHeadPosition(), @getHeadPosition())
    @update(params)

  isReversed: ->
    @tailed and @reversed

  hasTail: ->
    @tailed

  isValid: ->
    not @isDestroyed() and @valid

  isDestroyed: ->
    @destroyed

  isEqual: (other) ->
    isEqual(@toParams(true), other.toParams(true))

  getInvalidationStrategy: ->
    @invalidate


    if size(newParams)
      new MarkerPatch(@id, oldParams, newParams)

  # Private:
  applyPatch: (patch, textChanged=false) ->
    oldHeadPosition = @getHeadPosition()
    oldTailPosition = @getTailPosition()
