     if isHTML then syntax = 'css'
 
     text = editor.getText()
-    selectedText = editor.getSelectedText()
+    selected = editor.getSelectedText()
 
-    if selectedText.length isnt 0
+    if selected.length isnt 0
       try
-        sorted     = csscomb.processString(selectedText, syntax)
-        beautified = CSSBeautify(sorted, {
-          indent: '  '
+        sorted = csscomb.processString(selected, {
+          syntax: syntax
         })
-        editor.setTextInBufferRange(editor.getSelectedBufferRange(), beautified)
+        if isCSS
+          sorted = CSSBeautify(sorted, {
+            indent: '  '
+          })
+        editor.setTextInBufferRange(editor.getSelectedBufferRange(), sorted)
       catch e
         console.log(e)
     else
       try
-        sorted = csscomb.processString(text, syntax)
-        beautified = CSSBeautify(sorted, {
-          indent: '  '
+        sorted = csscomb.processString(text, {
+          syntax: syntax
         })
-        editor.setText(beautified)
+        if isCSS
+          sorted = CSSBeautify(sorted, {
+            indent: '  '
+          })
+        editor.setText(sorted)
       catch e
         console.log(e)


    return unless editor isnt no

    grammarName = editor.getGrammar().name.toLowerCase()
    isCSS  = grammarName is 'css'
    isScss = grammarName is 'scss'

CSSBeautify = require('cssbeautify')
CSSComb     = require('csscomb')

userConfigPath = atom.project.getDirectories()[0]?.resolve('.csscomb.json')
atomConfigPath = path.join(__dirname, '../csscomb.json')

module.exports =

