       @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()
+    @observeDecoration(decoration) for decoration in @model.getDecorations()
     @observeCursor(cursor) for cursor in @model.getCursors()
 
   observeConfig: ->


    {top, left, width, height}

  observeLineDecoration: (decoration) ->
    decorationDisposables = new CompositeDisposable
    decorationDisposables.add decoration.getMarker().onDidChange(@updateLinesState.bind(this))
    decorationDisposables.add decoration.onDidDestroy =>
      @disposables.remove(decorationDisposables)
      @updateLinesState()
    @disposables.add(decorationDisposables)

  observeLineNumberDecoration: (decoration) ->
    decorationDisposables = new CompositeDisposable
    decorationDisposables.add decoration.getMarker().onDidChange(@updateLineNumbersState.bind(this))
    decorationDisposables.add decoration.onDidDestroy =>
      @disposables.remove(decorationDisposables)
      @updateLineNumbersState()
    @disposables.add(decorationDisposables)

  observeHighlightDecoration: (decoration) ->
    decorationDisposables = new CompositeDisposable
    decorationDisposables.add decoration.getMarker().onDidChange(@updateHighlightsState.bind(this))
    decorationDisposables.add decoration.onDidChangeProperties(@updateHighlightsState.bind(this))
    decorationDisposables.add decoration.onDidFlash(@highlightDidFlash.bind(this, decoration))
    decorationDisposables.add decoration.onDidDestroy =>
      @disposables.remove(decorationDisposables)
      @updateHighlightsState()
    @disposables.add(decorationDisposables)

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

      decorationState.flashDuration = flash.duration
      @emitter.emit "did-update-state"

  didAddDecoration: (decoration) ->
    @observeDecoration(decoration)

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

  observeCursor: (cursor) ->
