 
     if @selectionsAreEmpty editor
       editor.setText(jsbeautify(editor.getText(), opts))
+
     else
       for selection in editor.getSelections()
         selection.insertText(jsbeautify(selection.getText(), opts), {select:true})

      return

    grammar = editor.getGrammar()?.scopeName

    if grammar is 'source.json' or grammar is 'source.js'
      @formatJavascript editor
    else
      notification = new FileTypeNotSupportedView(state)
      atom.workspaceView.append(notification)


          @editorSaveSubscriptions[editor.id] = buffer.onWillSave =>
            buffer.transact =>
              @format(state)

          @editorCloseSubscriptions[editor.id] = buffer.onDidDestroy =>
            @editorSaveSubscriptions[editor.id].dispose()
