 
             delete @editorSaveSubscriptions[editor.id]
             delete @editorCloseSubscriptions[editor.id]
+
+
+          # saveSubscription = buffer.onWillSave =>
+          #   buffer.transact =>
+          #     @format(state)
+          #
+          # closeSubscription = buffer.onDidDestroy =>
+          #   debugger
+          #
+          # @editorSaveSubscriptions.addSubscription(saveSubscription)
+          # @editorCloseSubscriptions.addSubscription(closeSubscription)
     else
       if @editorCreationSubscription
         @editorCreationSubscription.dispose()


    @editorSaveSubscriptions = {}
    @editorCloseSubscriptions = {}

    atom.config.observe 'jsformat.format_on_save', =>
      @subscribeToEvents()

        for subscriptionId, subscription of @editorCloseSubscriptions
          subscription.dispose()
          delete @editorCloseSubscriptions[subscriptionId]

        # @editorSaveSubscriptions.dispose()
        # @editorSaveSubscriptions = new Observer()
        #
        # @editorCloseSubscriptions.dispose()
        # @editorCloseSubscriptions = new Observer()
