Skip to content

Commit

Permalink
Implement minimap creation observer method for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Jan 4, 2015
1 parent 6385d44 commit e583763
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/main-v4.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ class V4Main

minimapForEditor: (editor) -> @editorsMinimaps[editor.id]

observeMinimaps: (iterator) ->
return unless iterator?
iterator({view: minimap}) for id,minimap of @editorsMinimaps
createdCallback = (minimap) -> iterator(minimap)
disposable = @onDidCreateMinimap(createdCallback)
disposable.off = ->
deprecate('Use Disposable::dispose instead')
disposable.dispose()
disposable

initSubscriptions: ->
Minimap ?= require './minimap'

Expand All @@ -40,4 +50,6 @@ class V4Main
editorElement = atom.views.getView(textEditor)
minimapElement = atom.views.getView(minimap)

@emitter.emit('did-create-minimap')

minimapElement.attach()

0 comments on commit e583763

Please sign in to comment.