   shouldPromptToSave: (options) ->
     @editor?.shouldPromptToSave(options) ? false
 
+  terminatePendingState: ->
+    @emitter.emit 'did-terminate-pending-state' if not @hasTerminatedPendingState
+    @hasTerminatedPendingState = true
+
   onWillOpen: (callback) ->
     @emitter.on 'will-open', callback
 


  onDidChangeTitle: (callback) ->
    @emitter.on 'did-change-title', callback

  applyChoice: ->
    return if @choiceApplied


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

      @saveConfig('TableEditor')
      @editor
