     opts.indent_size = editorSettings.tabLength
     opts.wrap_line_length = editorSettings.preferredLineLength
 
-    if @selectionsAreEmpty editor
+    if @selectionsAreEmpty(editor)
       editor.setText(jsbeautify(editor.getText(), opts))
 
     else

    if !editor
      return

    grammar = editor.getGrammar()?.scopeName
    mainCursor = editor.getCursors()[0]
    textBuffer = editor.getBuffer()
    nonWhitespaceRegex = /\S/g

      mainCursor.setBufferPosition(newCursorPosition)

    else
      @displayUnsupportedLanguageNotification(state)

  formatJavascript: (editor) ->
    editorSettings = atom.config.get('editor')
