 
   setEditorView: (@editorView) ->
     @editor = @editorView.getModel()
-    @buffer = @editorView.getEditor().buffer
+    @buffer = @editorView.getEditor().getBuffer()
+    @displayBuffer = @editor.displayBuffer
 
     @subscribe @editor, 'screen-lines-changed.minimap', (changes) =>
-      @pendingChanges.push changes
+      #@pendingChanges.push changes
+      @requestUpdate()
+
+    @subscribe @editor, 'contents-modified.minimap', =>
+      @requestUpdate()
+
+    @subscribe @displayBuffer, 'tokenized.minimap', =>
       @requestUpdate()
 
   requestUpdate: ->

      @tag 'canvas', {
        outlet: 'lineCanvas'
        class: 'minimap-canvas'
        width: 120
        height: 1000
        id: 'line-canvas'
      }



  update: =>
    return unless @editorView?
    return unless @displayBuffer.tokenizedBuffer.fullyTokenized

    #reset canvas virtual width/height
    @lineCanvas[0].width = @lineCanvas[0].offsetWidth
