     @nextMarkerId = 1
     @outstandingSaveCount = 0
     @loadCount = 0
+    @cachedHasAstral = null
     @_emittedWillChangeEvent = false
 
     @setEncoding(params?.encoding)

      @_emittedWillChangeEvent = true

  emitDidChangeTextEvent: ->
    if @transactCallDepth is 0
      if @changesSinceLastDidChangeTextEvent.length > 0
        compactedChanges = patchFromChanges(@changesSinceLastDidChangeTextEvent).getChanges()

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

  ###
  Section: Mutating Text
