     text = params if typeof params is 'string'
 
     @emitter = new Emitter
-    @changesSinceLastStoppedChangingEvent = []
+    @patchesSinceLastStoppedChangingEvent = []
     @didChangeTextPatch = new Patch
     @id = params?.id ? crypto.randomBytes(16).toString('hex')
     @lines = ['']

    stoppedChangingCallback = =>
      @stoppedChangingTimeout = null
      modifiedStatus = @isModified()
      @emitter.emit 'did-stop-changing', {changes: Object.freeze(normalizePatchChanges(Patch.composeChanges(@changesSinceLastStoppedChangingEvent)))}
      @changesSinceLastStoppedChangingEvent = []
      @emitModifiedStatusChanged(modifiedStatus)
    @stoppedChangingTimeout = setTimeout(stoppedChangingCallback, @stoppedChangingDelay)


      markerLayer.emitChangeEvents(snapshot?[markerLayerId])

  handleChangedText: ->
    @emitter.emit 'did-change-text', {changes: Object.freeze(normalizePatchChanges(@didChangeTextPatch.getChanges()))}
    @patchesSinceLastStoppedChangingEvent.push(@didChangeTextPatch)
    @didChangeTextPatch = new Patch

  # Identifies if the buffer belongs to multiple editors.
