         @deleteRowsAtRange(oldScreenRange)
         @createRowsAtRange(newScreenRange)
         @markIntermediateTime("update buffer change")
+
       catch e
         continue
 
     @endBench('complete update')
+    @emit 'minimap:updated'
 
   deleteRowsAtRange: (range) ->
     linesWrapper = @lines[0].childNodes[0]

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

    @markIntermediateTime('cleaning')
    # FIXME: If the file is very large, the tokenizes doesn't generate
    # completely, so doesn't have the syntax highlight until a new view
    # is activated in the same pane.
    numLines = @editorView.getModel().displayBuffer.getLines().length
    lines = @editorView.buildLineElementsForScreenRows(0, numLines)

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

    @endBench('minimap update')

  getClientRect: ->
    sv = @scrollView[0]


  update: =>
    return unless @editorView?

    if @bufferChanges.length > 0
      @updateMinimapWithBufferChanges()
    else
      @rebuildMinimap()

  updateMinimapWithBufferChanges: ->
    @startBench()
