atom/atom — pull request #2819 by benogle (2014-07-04 01:11:47+00:00)
Title: WIP: Update the decoration API

Starting this PR super early. I want to layout what I am thinking before getting into it.

### Editor / DisplayBuffer

* `(Decoration) addDecoration(marker, decorationParams)`
* `(void) removeDecoration(decoration or decorationId)`
* `(void) removeDecorationsFromMarker(marker, decorationPattern)`

I think we should either take the `decorateMarker` or `addDecoration`. I lean toward `addDecoration` because it is easy to guess the inverse. IMO, `decorateMarker` best matches the form we have with markers: `markBufferRange`. `decorate` is tempting, but the removal is awkward (`undecorate(decoration)`??) and hard to guess, IMO.

I think we should have two different removal functions as the arguments are quite a bit different: either you have a decoration, or you want some pattern matching.

These should remain unchanged:

* `(Decoration) decorationForId(decorationId)`
* `(Object) decorationsForScreenRowRange(startScreenRow, endScreenRow)`

### Decoration

New

* `(void) destroy()` - this just calls `displayBuffer::removeDecoration(this)`
* `(void) update(newParams)` - update the params with newParams, emit an event. Thinking the `HighlightComponent` could listen for this like the flash?