     @disposables.add @buffer.onDidChangeEncoding =>
       @emitter.emit 'did-change-encoding', @getEncoding()
     @disposables.add @buffer.onDidDestroy => @destroy()
+    if @pending
+      @disposables.add @buffer.onDidChangeModified =>
+        @confirmPendingState() if @buffer.isModified()
 
     @preserveCursorPositionOnBufferReload()
 

      softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation,
      @mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config,
      @notificationManager, @packageManager, @clipboard, @viewRegistry, @grammarRegistry,
      @project, @assert, @applicationDelegate
    } = params

    throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
    throw new Error("Must pass a notificationManager parameter when constructing TextEditors") unless @notificationManager?


  # Essential: Returns {Boolean} `true` if this editor has no content.
  isEmpty: -> @buffer.isEmpty()

  # Returns {Boolean} `true` if this editor is pending and `false` if it is permanent.
  isPending: -> Boolean(@pending)

  # Copies the current file path to the native clipboard.
  copyPathToClipboard: ->
