 
   toggleCursorBlink: ->
     @state.content.cursorsVisible = not @state.content.cursorsVisible
-    @emitter.emit 'did-update-state'
+    @needsRefresh()
 
   pauseCursorBlinking: ->
     @stopBlinkingCursors(true)
     @startBlinkingCursorsAfterDelay ?= _.debounce(@startBlinkingCursors, @getCursorBlinkResumeDelay())
     @startBlinkingCursorsAfterDelay()
-    @emitter.emit 'did-update-state'
+    @needsRefresh()

      decorationClasses: @lineDecorationClassesForRow(row)

  updateCursorsState: ->
    if @isInBatchMode()
      @shouldUpdateCursorsState = true
      @emitter.emit "did-update-state"
    else
      @state.content.cursors = {}

      @updateCursorState(cursor) for cursor in @model.cursors # using property directly to avoid allocation

  updateCursorState: (cursor, destroyOnly = false) ->
    if @isInBatchMode()
      @shouldUpdateCursorsState = true
      @emitter.emit "did-update-state"
    else
      delete @state.content.cursors[cursor.id]




  updateLinesState: ->
    if @isBatching()
      @shouldUpdateLinesState = true
      @needsRefresh()
    else
      return unless @startRow? and @endRow? and @lineHeight?

