       decorationState.flashDuration = flash.duration
       @emitter.emit "did-update-state"
 
-  observeOverlayDecoration: (decoration) ->
-    decorationDisposables = new CompositeDisposable
-    decorationDisposables.add decoration.getMarker().onDidChange(@updateOverlaysState.bind(this))
-    decorationDisposables.add decoration.onDidChangeProperties(@updateOverlaysState.bind(this))
-    decorationDisposables.add decoration.onDidDestroy =>
-      @disposables.remove(decorationDisposables)
-      @updateOverlaysState()
-    @disposables.add(decorationDisposables)
-
   didAddDecoration: (decoration) ->
+    @observeDecoration(decoration)
+
     if decoration.isType('line')
-      @observeLineDecoration(decoration)
       @updateLinesState()
     if decoration.isType('line-number')
-      @observeLineNumberDecoration(decoration)
       @updateLineNumbersState()
     else if decoration.isType('highlight')
-      @observeHighlightDecoration(decoration)
       @updateHighlightsState()
     else if decoration.isType('overlay')
-      @observeOverlayDecoration(decoration)
       @updateOverlaysState()
 
   observeCursor: (cursor) ->

      @updateLineNumbersState()
    @disposables.add @model.onDidAddDecoration(@didAddDecoration.bind(this))
    @disposables.add @model.onDidAddCursor(@didAddCursor.bind(this))
    @observeLineDecoration(decoration) for decoration in @model.getLineDecorations()
    @observeLineNumberDecoration(decoration) for decoration in @model.getLineNumberDecorations()
    @observeHighlightDecoration(decoration) for decoration in @model.getHighlightDecorations()
    @observeOverlayDecoration(decoration) for decoration in @model.getOverlayDecorations()
    @observeCursor(cursor) for cursor in @model.getCursors()

  observeConfig: ->


    {top, left, width, height}

  observeDecoration: (decoration) ->
    decorationDisposables = new CompositeDisposable
    decorationDisposables.add decoration.getMarker().onDidChange(@decorationMarkerDidChange.bind(this, decoration))
    if decoration.isType('highlight')
      decorationDisposables.add decoration.onDidChangeProperties(@updateHighlightsState.bind(this))
      decorationDisposables.add decoration.onDidFlash(@highlightDidFlash.bind(this, decoration))
    decorationDisposables.add decoration.onDidDestroy =>
      @disposables.remove(decorationDisposables)
      @didDestroyDecoration(decoration)
    @disposables.add(decorationDisposables)

  decorationMarkerDidChange: (decoration) ->
    if decoration.isType('line')
      @updateLinesState()
    if decoration.isType('line-number')
      @updateLineNumbersState()
    if decoration.isType('highlight')
      @updateHighlightsState()
    if decoration.isType('overlay')
      @updateOverlaysState()

  didDestroyDecoration: (decoration) ->
    if decoration.isType('line')
      @updateLinesState()
    if decoration.isType('line-number')
      @updateLineNumbersState()
    if decoration.isType('highlight')
      @updateHighlightsState()
    if decoration.isType('overlay')
      @updateOverlaysState()

  highlightDidFlash: (decoration) ->
    flash = decoration.consumeNextFlash()
