@@ -6,11 +6,13 @@ class MinimapHighlightSelected
66 @subscriptions = new CompositeDisposable
77
88 activate : (state ) ->
9+ unless atom .inSpecMode ()
10+ require (' atom-package-deps' ).install ' minimap-highlight-selected' , true
911
1012 consumeMinimapServiceV1 : (@minimap ) ->
1113 @minimap .registerPlugin ' highlight-selected' , this
1214
13- consumeHighlightSelectedServiceV1 : (@highlightSelected ) ->
15+ consumeHighlightSelectedServiceV2 : (@highlightSelected ) ->
1416 @ init () if @minimap ? and @active ?
1517
1618 deactivate : ->
@@ -34,21 +36,21 @@ class MinimapHighlightSelected
3436
3537 init : =>
3638 @decorations = []
37- @highlightSelected .onDidAddMarker (marker ) => @ markerCreated (marker )
38- @highlightSelected .onDidAddSelectedMarker (marker ) => @ markerCreated (marker , true )
39+ @highlightSelected .onDidAddMarkerForEditor (options ) => @ markerCreated (options )
40+ @highlightSelected .onDidAddSelectedMarkerForEditor (options ) => @ markerCreated (options , true )
3941 @highlightSelected .onDidRemoveAllMarkers => @ markersDestroyed ()
4042
4143 dispose : =>
4244 @decorations ? .forEach (decoration) -> decoration .destroy ()
4345 @decorations = null
4446
45- markerCreated : (marker , selected = false ) =>
46- activeMinimap = @minimap .getActiveMinimap ( )
47- return unless activeMinimap ?
47+ markerCreated : (options , selected = false ) =>
48+ minimap = @minimap .minimapForEditor ( options . editor )
49+ return unless minimap ?
4850 className = ' highlight-selected'
4951 className += ' selected' if selected
5052
51- decoration = activeMinimap .decorateMarker (marker,
53+ decoration = minimap .decorateMarker (options . marker ,
5254 {type : ' highlight' , class : className })
5355 @decorations .push decoration
5456
0 commit comments