 
   update: =>
     return unless @editorView?
-    return if @frameRequested
 
-    @frameRequested = true
-    webkitRequestAnimationFrame =>
-      @frameRequested = false
-      if @bufferChanges.length > 0
-        @updateMinimapWithBufferChanges()
-      else
-        @rebuildMinimap()
-
-      @emit 'minimap:updated'
+    if @bufferChanges.length > 0
+      @updateMinimapWithBufferChanges()
+    else
+      @rebuildMinimap()
 
   updateMinimapWithBufferChanges: ->
     @startBench()

Debug = require 'prolix'

module.exports =
class MinimapEditorView extends ScrollView
  Emitter.includeInto(this)
  Debug('minimap').includeInto(this)


    @lines.css fontSize: "#{@editorView.getFontSize()}px"

    @markIntermediateTime('cleaning')

    numLines = @editorView.getModel().displayBuffer.getLines().length

    wrapper = $('<div/>')
    @lines.append wrapper

    batchSize = 100
    batch = (start=0) =>
      end = Math.min(start + batchSize, numLines)
      @log start, end
      lines = @editorView.buildLineElementsForScreenRows(start, end)

      @markIntermediateTime('batch finished')
      wrapper.append lines
      if end is numLines
        @rebuilding = false
        @endBench('minimap update')
        @emit 'minimap:updated'        
      else
        webkitRequestAnimationFrame -> batch(end + 1)

    batch()

  getClientRect: ->
    sv = @scrollView[0]
