     text = params if typeof params is 'string'
 
     @emitter = new Emitter
-    @stoppedChangingPatch = new Patch(combineChanges: true)
+    @stoppedChangingPatch = new Patch(combineChanges: true, batchMode: true)
+    @didChangeTextPatch = new Patch(combineChanges: true, batchMode: true)
     @id = params?.id ? crypto.randomBytes(16).toString('hex')
     @lines = ['']
     @lineEndings = ['']

      markerLayer.emitChangeEvents(snapshot?[markerLayerId])

  emitChangeTextEvent: ->
    return unless @didChangeTextPatch?

    @emitter.emit 'did-change-text', Object.freeze(normalizePatchChanges(@didChangeTextPatch.getChanges()))
    @didChangeTextPatch = null

  # Identifies if the buffer belongs to multiple editors.
  #


    @changeCount++
    @stoppedChangingPatch.splice(oldRange.start, oldRange.getExtent(), newRange.getExtent(), text: newText)
    @didChangeTextPatch.splice(oldRange.start, oldRange.getExtent(), newRange.getExtent(), text: newText)
    @emitter.emit 'did-change', changeEvent

