 
   onDidChangeTitle: (callback) ->
     @emitter.on 'did-change-title', callback
+
+  onDidTerminatePendingState: (callback) ->
+    @emitter.on 'did-terminate-pending-state', callback
 
   applyChoice: ->
     return if @choiceApplied

  shouldPromptToSave: (options) ->
    @editor?.shouldPromptToSave(options) ? false

  onWillOpen: (callback) ->
    @emitter.on 'will-open', callback



      @emitter.emit 'did-open', {@editor, options: _.clone(options)}
      @emitter.emit 'did-change-modified', @editor.isModified()
      @terminatePendingState()

      @saveConfig('TableEditor')
      @editor
