Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
as-cii authored and Antonio Scandurra committed May 2, 2016
1 parent 1e9aade commit 8ec79d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/marker-layer-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe "MarkerLayer", ->
expect(layer2.findMarkers(containsPoint: [0, 4])).toEqual [layer2Marker]

describe "::onDidUpdate", ->
it "notifies observers synchronously or at the end of a transaction when markers are created, updated, invalidated, or destroyed", ->
it "notifies observers synchronously or at the end of a transaction when markers are created, updated directly, updated indirectly, or destroyed", ->
layer = buffer.addMarkerLayer({maintainHistory: true})
events = []
[marker1, marker2, marker3] = []
Expand Down
4 changes: 2 additions & 2 deletions src/marker-layer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MarkerLayer

constructor: (@delegate, @id, options) ->
@maintainHistory = options?.maintainHistory ? false
@destroytouchedMarkers = options?.destroytouchedMarkers ? false
@destroyInvalidatedMarkers = options?.destroyInvalidatedMarkers ? false
@persistent = options?.persistent ? false
@emitter = new Emitter
@index = new MarkerIndex
Expand Down Expand Up @@ -259,7 +259,7 @@ class MarkerLayer
marker = @markersById[id]
@touchedMarkers.add(id)
if invalidated[marker.getInvalidationStrategy()]?.has(id)
if @destroytouchedMarkers
if @destroyInvalidatedMarkers
marker.destroy()
else
marker.valid = false
Expand Down
10 changes: 5 additions & 5 deletions src/marker.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ class Marker
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidChange: (callback) ->
Grim.deprecate("""
Subscribing to marker change events is deprecated. Please, consider using
MarkerLayer.prototype.onDidUpdate instead.
""")

unless @hasChangeObservers
Grim.deprecate("""
Subscribing to marker change events is deprecated. Please, consider using
`MarkerLayer.prototype.onDidUpdate` instead.
""")

@previousEventState = @getSnapshot(@getRange())
@hasChangeObservers = true
@layer.markersIdsWithChangeSubscriptions.add(@id)
Expand Down

0 comments on commit 8ec79d4

Please sign in to comment.