       @_emittedWillChangeEvent = true
 
   emitDidChangeTextEvent: ->
+    @cachedHasAstral = null
     if @transactCallDepth is 0
       if @changesSinceLastDidChangeTextEvent.length > 0
         compactedChanges = patchFromChanges(@changesSinceLastDidChangeTextEvent).getChanges()

    @nextMarkerId = 1
    @outstandingSaveCount = 0
    @loadCount = 0
    @_emittedWillChangeEvent = false

    @setEncoding(params?.encoding)

  # are encoded as surrogate pairs.
  #
  # Returns a {Boolean}.
  hasAstral: ->
    if @cachedHasAstral isnt null
      @cachedHasAstral
    else
      @cachedHasAstral = @buffer.hasAstral()
      @cachedHasAstral

  ###
  Section: Mutating Text
